CodeChain-io / CodeChain-io/foundry

Use #[derive(RlpEncodableWrapper, RlpDecodableWrapper)]

Open
#65 2 comments 0 reactions 1 assignee Claimed by @junha1 View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.