Skip to content

Commit 2b27a71

Browse files
authored
Merge pull request #208 from matoushybl/fix/serde-nostd
Do not use alloc-dependent format! in serde expansion
2 parents 93f4bf5 + db0eefc commit 2b27a71

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

nutype_macros/src/common/gen/traits.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,7 @@ pub fn gen_impl_trait_serde_deserialize(
294294
quote! {
295295
#type_name::try_new(raw_value).map_err(|validation_error| {
296296
// Add a hint about which type is causing the error,
297-
let err_msg = format!("{validation_error} Expected valid {}", #type_name_str);
298-
<DE::Error as serde::de::Error>::custom(err_msg)
297+
<DE::Error as serde::de::Error>::custom(core::format_args!("{validation_error} Expected valid {}", #type_name_str))
299298
})
300299
}
301300
} else {

0 commit comments

Comments
 (0)