remove alloc::format! again, still causes linker errors

This commit is contained in:
Tadeo hepperle
2024-02-02 09:13:27 +01:00
parent 87200b441a
commit 57743c3a1a
+4 -5
View File
@@ -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 {