Skip to content

Commit

Permalink
🚧 work in progress : tuple and default values
Browse files Browse the repository at this point in the history
  • Loading branch information
Roms1383 committed Feb 7, 2024
1 parent fd4ea0d commit a27f20f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ fn derive_reds_value_for_struct(name: &syn::Ident, r#struct: &syn::DataStruct) -
}
let mut args = Vec::<String>::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(", ")))
}
Expand All @@ -83,7 +83,7 @@ fn derive_reds_value_for_struct(name: &syn::Ident, r#struct: &syn::DataStruct) -
}
let mut args = Vec::<String>::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(", ")))
}
Expand Down

0 comments on commit a27f20f

Please sign in to comment.