diff --git a/metadata/src/from_into/v14.rs b/metadata/src/from_into/v14.rs index dec3a4c566..b9b13cf681 100644 --- a/metadata/src/from_into/v14.rs +++ b/metadata/src/from_into/v14.rs @@ -8,7 +8,7 @@ use alloc::borrow::ToOwned; use alloc::string::String; use alloc::vec; use alloc::vec::Vec; - +use core::fmt::Write; use frame_metadata::{v14, v15}; use hashbrown::HashMap; use scale_info::TypeDef; @@ -372,11 +372,10 @@ fn generate_outer_error_enum_type( return None; }; - // Note: using the `format!` macro like in `let path = format!("{}Error", pallet.name);` + // Note: using the `alloc::format!` macro like in `let path = format!("{}Error", pallet.name);` // leads to linker errors about extern function `_Unwind_Resume` not being defined. - // let mut path = String::new(); - // write!(path, "{}Error", pallet.name).expect("Cannot panic, qed;"); - let path = alloc::format!("{}Error", pallet.name); + let mut path = String::new(); + write!(path, "{}Error", pallet.name).expect("Cannot panic, qed;"); let ty = error.ty.id.into(); Some(scale_info::Variant {