News for hackers. Stuff that matters.
Re:Rust for JavaScript Developers – Pattern Matching and Enums by mamcx on Sunday July 12, 2020 @09:02PM (#23816117)
> This often makes the system brittle to new changes because subsystems have very strict expectations of data schema, even when they don't really need to care about i

I deal a lot with this, because I interface with software outside my control. In the case of Rust I find super easy to solve, just use this litte trick:

https://serde.rs/attr-flatten.html

#[derive(Serialize, Deserialize)] struct User { id: String, username: String,

     #[serde(flatten)]
     extra: HashMap<String, Value>,
 }
Serde is very good. Near all you want is there.
Re:Rust for JavaScript Developers – Pattern Matching and Enums by Dowwie on Monday July 13, 2020 @09:03AM (#23820302)
this is a great recipe