CodeChain-io / CodeChain-io/foundry

Use #[derive(RlpEncodableWrapper, RlpDecodableWrapper)]

Aperta
#65 2 commenti 0 reazioni 1 assegnatario Rivendicata da @junha1 Vedi su GitHub
good first issue refactoring
Lingua principale
Rust
Stelle
36
Fork
11
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

```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.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.