From 57743c3a1a6d95535f1955e8f915539a3d9b18fc Mon Sep 17 00:00:00 2001 From: Tadeo hepperle Date: Fri, 2 Feb 2024 09:13:27 +0100 Subject: [PATCH] remove alloc::format! again, still causes linker errors --- metadata/src/from_into/v14.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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 {