From f8c4b8f33d3da5a943bfa29a14abdb3484122083 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Fri, 31 Jul 2026 13:57:06 +0100 Subject: Add Clone and Copy to generated Rust types --- examples/03-sum/output/rust/src/shapes.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'examples/03-sum/output') diff --git a/examples/03-sum/output/rust/src/shapes.rs b/examples/03-sum/output/rust/src/shapes.rs index a0a9b7f..2712e41 100644 --- a/examples/03-sum/output/rust/src/shapes.rs +++ b/examples/03-sum/output/rust/src/shapes.rs @@ -1,7 +1,7 @@ // Generated by hobgoblin. /// A 2D shape. -#[derive(Debug, Hash, PartialEq)] +#[derive(Clone, Debug, Hash, PartialEq)] pub enum Shape { Rectangle(crate::shapes::Rectangle), Triangle(crate::shapes::Triangle), @@ -19,13 +19,13 @@ impl ::std::convert::From:: for crate::shapes::Shape { } } -#[derive(Debug, Hash, PartialEq)] +#[derive(Clone, Debug, Hash, PartialEq)] pub struct Rectangle { pub width: ::core::primitive::i32, pub height: ::core::primitive::i32, } -#[derive(Debug, Hash, PartialEq)] +#[derive(Clone, Debug, Hash, PartialEq)] pub struct Triangle { pub width: ::core::primitive::i32, pub height: ::core::primitive::i32, -- cgit v1.2.3