foundry
foundry copied to clipboard
Use #[derive(RlpEncodableWrapper, RlpDecodableWrapper)]
struct StructWithSingleField<T> {
field: T
}
impl<T: Encodable> Encodable for StructWithSingleField<T> {
fn rlp_append(&self, s: &mut RlpStream) {
self.field.rlp_append(s);
}
}
can be simplified to
#[derive(RlpEncodableWrapper)]
struct StructWithSingleField<T> {
field: T
}
It can be applied to struct StructWithSingleTuple<T>(T)
, and RlpDecodable
too.
I searched with the keyword impl Encodable
but there was no such results. I think this issue was isolated a long time ago.
I found that the Encodable
implementation for SignedMessage
can use the RlpEncodableWrapper
.