projects
/
rust-lightning
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
25b9fd8
)
Use more descriptive names in serialization impl macros
2021-03-fix-lens
author
Matt Corallo
<git@bluematt.me>
Wed, 24 Mar 2021 18:31:03 +0000
(14:31 -0400)
committer
Matt Corallo
<git@bluematt.me>
Tue, 27 Apr 2021 01:09:12 +0000
(
01:09
+0000)
lightning/src/util/ser_macros.rs
patch
|
blob
|
history
diff --git
a/lightning/src/util/ser_macros.rs
b/lightning/src/util/ser_macros.rs
index e99c4e0eb2896e5bedc2e03fed912c63b3912847..5062bae769cf9d9d752791226875a131ae58895e 100644
(file)
--- a/
lightning/src/util/ser_macros.rs
+++ b/
lightning/src/util/ser_macros.rs
@@
-145,11
+145,11
@@
macro_rules! impl_writeable {
}
}
macro_rules! impl_writeable_len_match {
}
}
macro_rules! impl_writeable_len_match {
- ($st
:ident, $cmp: tt, {$({$m: pat, $l
: expr}),*}, {$($field:ident),*}) => {
- impl Writeable for $st {
+ ($st
ruct: ident, $cmp: tt, {$({$match: pat, $length
: expr}),*}, {$($field:ident),*}) => {
+ impl Writeable for $st
ruct
{
fn write<W: Writer>(&self, w: &mut W) -> Result<(), ::std::io::Error> {
let len = match *self {
fn write<W: Writer>(&self, w: &mut W) -> Result<(), ::std::io::Error> {
let len = match *self {
- $($m
=> $l
,)*
+ $($m
atch => $length
,)*
};
w.size_hint(len);
#[cfg(any(test, feature = "fuzztarget"))]
};
w.size_hint(len);
#[cfg(any(test, feature = "fuzztarget"))]
@@
-165,7
+165,7
@@
macro_rules! impl_writeable_len_match {
}
}
}
}
- impl ::util::ser::Readable for $st {
+ impl ::util::ser::Readable for $st
ruct
{
fn read<R: ::std::io::Read>(r: &mut R) -> Result<Self, DecodeError> {
Ok(Self {
$($field: Readable::read(r)?),*
fn read<R: ::std::io::Read>(r: &mut R) -> Result<Self, DecodeError> {
Ok(Self {
$($field: Readable::read(r)?),*
@@
-173,8
+173,8
@@
macro_rules! impl_writeable_len_match {
}
}
};
}
}
};
- ($st
:ident, {$({$m: pat, $l
: expr}),*}, {$($field:ident),*}) => {
- impl_writeable_len_match!($st
, ==, { $({ $m, $l
}),* }, { $($field),* });
+ ($st
ruct: ident, {$({$match: pat, $length
: expr}),*}, {$($field:ident),*}) => {
+ impl_writeable_len_match!($st
ruct, ==, { $({ $match, $length
}),* }, { $($field),* });
}
}
}
}