diff options
| author | Michael Williamson <mike@zwobble.org> | 2026-07-14 19:49:24 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2026-07-14 19:49:24 +0100 |
| commit | f189d982951f7f0e2c3560a20c0d1d8a2b6431d0 (patch) | |
| tree | 2c369ef2467f91aaa1a03071998831d0f84e6e7b /examples/02-sum/output/rust/src/shapes.rs | |
| parent | 0e51a1497b98bd190d304acc4c1e1e1f56bf03c7 (diff) | |
Derive Debug and PartialEq for generated Rust types
Diffstat (limited to 'examples/02-sum/output/rust/src/shapes.rs')
| -rw-r--r-- | examples/02-sum/output/rust/src/shapes.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/examples/02-sum/output/rust/src/shapes.rs b/examples/02-sum/output/rust/src/shapes.rs index d5b7334..f06dd2b 100644 --- a/examples/02-sum/output/rust/src/shapes.rs +++ b/examples/02-sum/output/rust/src/shapes.rs @@ -1,6 +1,7 @@ // Generated by hobgoblin. /// A 2D shape. +#[derive(Debug, PartialEq)] pub enum Shape { Rectangle(crate::shapes::Rectangle), Triangle(crate::shapes::Triangle), @@ -18,11 +19,13 @@ impl ::std::convert::From<crate::shapes::Triangle> for crate::shapes::Shape { } } +#[derive(Debug, PartialEq)] pub struct Rectangle { pub width: ::core::primitive::i32, pub height: ::core::primitive::i32, } +#[derive(Debug, PartialEq)] pub struct Triangle { pub width: ::core::primitive::i32, pub height: ::core::primitive::i32, |
