Rust is bad in the description, solutions must be explained to the description
Rust Internals
Rust is bad in the description, solutions must be explained to the description
struct Shape { id: u32, color: Color, kind: ShapeKind } enum ShapeKind { Circle { r: f64 }, Rect { w: f64, h: f64 } } match shape.kind { ShapeKind::Circle {..} ... } Brother, it makes you write a lot of lines to reach one thing, and this is what I seek to finish. Imagine that you can do this. envelope Shape { id: u32, color: Color = Color::Black, | Circle { r: f64 } | Rect { w: f64, h: f64 } | Empty } Shared fields are connected directly w...
0 comments
No comments yet.