diff --git a/01.workspace/heave/examples/simple_product.rs b/01.workspace/heave/examples/simple_product.rs index cadeba6..58f3195 100644 --- a/01.workspace/heave/examples/simple_product.rs +++ b/01.workspace/heave/examples/simple_product.rs @@ -1,7 +1,7 @@ use heave::*; // Define a struct named `Product` to represent a product. -#[derive(PartialEq)] +#[derive(PartialEq, Clone)] struct Product { // `id` is a public field of type `String` to uniquely identify the product. pub id: String, diff --git a/01.workspace/heave/examples/working_with_many_types.rs b/01.workspace/heave/examples/working_with_many_types.rs index 5221a09..c4d0a53 100644 --- a/01.workspace/heave/examples/working_with_many_types.rs +++ b/01.workspace/heave/examples/working_with_many_types.rs @@ -1,27 +1,27 @@ use heave::*; use std::path::Path; -#[derive(PartialEq)] +#[derive(PartialEq, Clone)] struct Laptop { pub id: String, pub model: String, pub price: u64, } -#[derive(PartialEq)] +#[derive(PartialEq, Clone)] struct Display { pub id: String, pub model: String, pub resolution: f64, pub price: u64, } -#[derive(PartialEq)] +#[derive(PartialEq, Clone)] struct Mouse { pub id: String, pub model: String, pub wireless: bool, pub price: u64, } -#[derive(PartialEq)] +#[derive(PartialEq, Clone)] enum Product { None, Laptop(Laptop), diff --git a/01.workspace/heave/src/trt/eav.rs b/01.workspace/heave/src/trt/eav.rs index 2a872de..9cdedf4 100644 --- a/01.workspace/heave/src/trt/eav.rs +++ b/01.workspace/heave/src/trt/eav.rs @@ -8,6 +8,7 @@ pub trait T where Self: TryFrom, Self: TryInto, Self: PartialEq, + Self: Clone, { /// Returns the class name of the type. ///