Explicitly refer to `format!()` with an `alloc` prefix for no-std
[ldk-c-bindings] / c-bindings-gen / src / main.rs
index 97f44a4c4c458e22ce017c0b8c53d8524077cea2..647f344bcefa5dba7ed4df54926157f69ffc951e 100644 (file)
@@ -1248,7 +1248,7 @@ fn writeln_impl<W: std::io::Write>(w: &mut W, i: &syn::ItemImpl, types: &mut Typ
                                                let self_ty = &i.self_ty;
                                                let ref_type: syn::Type = syn::parse_quote!(&#self_ty);
                                                let new_var = types.write_from_c_conversion_new_var(w, &format_ident!("o"), &ref_type, Some(&gen_types));
-                                               write!(w, "\tformat!(\"{{}}\", ").unwrap();
+                                               write!(w, "\talloc::format!(\"{{}}\", ").unwrap();
                                                types.write_from_c_conversion_prefix(w, &ref_type, Some(&gen_types));
                                                write!(w, "{}o", if new_var { "local_" } else { "" }).unwrap();
                                                types.write_from_c_conversion_suffix(w, &ref_type, Some(&gen_types));