Skip to content

Commit

Permalink
Merge pull request #208 from matoushybl/fix/serde-nostd
Browse files Browse the repository at this point in the history
Do not use alloc-dependent format! in serde expansion
  • Loading branch information
greyblake authored Feb 9, 2025
2 parents 93f4bf5 + db0eefc commit 2b27a71
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions nutype_macros/src/common/gen/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,7 @@ pub fn gen_impl_trait_serde_deserialize(
quote! {
#type_name::try_new(raw_value).map_err(|validation_error| {
// Add a hint about which type is causing the error,
let err_msg = format!("{validation_error} Expected valid {}", #type_name_str);
<DE::Error as serde::de::Error>::custom(err_msg)
<DE::Error as serde::de::Error>::custom(core::format_args!("{validation_error} Expected valid {}", #type_name_str))
})
}
} else {
Expand Down

0 comments on commit 2b27a71

Please sign in to comment.