From 2e5e7a174384f44e67533806da2fc5ba59488902 Mon Sep 17 00:00:00 2001 From: "Joshua M. Clulow" Date: Wed, 15 Sep 2021 06:40:32 +0000 Subject: [PATCH] make structs cloneable --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 0beac7f..3cbe1a4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -943,7 +943,7 @@ fn gen(api: &OpenAPI, ts: &mut TypeSpace) -> Result { for te in ts.id_to_entry.values() { match &te.details { TypeDetails::Object(omap) => { - a(" #[derive(Serialize, Deserialize, Debug)]"); + a(" #[derive(Serialize, Deserialize, Debug, Clone)]"); a(&format!( " pub struct {} {{", te.name.as_deref().unwrap() @@ -960,7 +960,7 @@ fn gen(api: &OpenAPI, ts: &mut TypeSpace) -> Result { } TypeDetails::NewType(tid) => { let n = te.name.as_deref().unwrap(); - a(" #[derive(Serialize, Deserialize, Debug)]"); + a(" #[derive(Serialize, Deserialize, Debug, Clone)]"); a(&format!( " pub struct {}({});", n,