From a27f20fda171de9b6ddf213cb9ba7339df53750b Mon Sep 17 00:00:00 2001 From: Roms1383 Date: Wed, 7 Feb 2024 11:11:30 +0700 Subject: [PATCH] :construction: work in progress : tuple and default values --- macros/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/macros/src/lib.rs b/macros/src/lib.rs index c8112b5..1bddea8 100644 --- a/macros/src/lib.rs +++ b/macros/src/lib.rs @@ -66,7 +66,7 @@ fn derive_reds_value_for_struct(name: &syn::Ident, r#struct: &syn::DataStruct) - } let mut args = Vec::::new(); #( - args.push(self.#indexes.reds_value().unwrap_or(self.#indexes.default())); + args.push(self.#indexes.reds_value().unwrap_or(Default::default())); )* Some(format!("new {}({})", Self::NAME, args.join(", "))) } @@ -83,7 +83,7 @@ fn derive_reds_value_for_struct(name: &syn::Ident, r#struct: &syn::DataStruct) - } let mut args = Vec::::new(); #( - args.push(self.#fields.reds_value().unwrap_or(self.#fields.default())); + args.push(self.#fields.reds_value().unwrap_or(Default::default())); )* Some(format!("new {}({})", Self::NAME, args.join(", "))) }