CodeChain-io / CodeChain-io/foundry
Use #[derive(RlpEncodableWrapper, RlpDecodableWrapper)]
Open
good first issue
refactoring
- Dominant language
- Rust
- Stars
- 36
- Forks
- 11
- PR merge metrics
- No merged PRs in 30d
Description
```rust
struct StructWithSingleField {
field: T
}
impl Encodable for StructWithSingleField {
fn rlp_append(&self, s: &mut RlpStream) {
self.field.rlp_append(s);
}
}
```
can be simplified to
```rust
#[derive(RlpEncodableWrapper)]
struct StructWithSingleField {
field: T
}
```
It can be applied to `struct StructWithSingleTuple(T)`, and `RlpDecodable` too.
Contributor guide
Assessment
This issue has not been assessed yet.