diff options
Diffstat (limited to 'subplotlib-derive/src/lib.rs')
-rw-r--r-- | subplotlib-derive/src/lib.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/subplotlib-derive/src/lib.rs b/subplotlib-derive/src/lib.rs index 7fd1810..86f5c5e 100644 --- a/subplotlib-derive/src/lib.rs +++ b/subplotlib-derive/src/lib.rs @@ -1,5 +1,6 @@ use proc_macro::TokenStream; use proc_macro2::Span; +use std::fmt::Write; use syn::{ parse_macro_input, parse_quote, Error, FnArg, Ident, ItemFn, Pat, PathArguments, ReturnType, Type, @@ -372,7 +373,7 @@ fn process_step(mut input: ItemFn) -> proc_macro2::TokenStream { Some(&contexttype) }; for context in outer_ctx.into_iter().chain(contexts.iter()) { - contextattrs.push_str(&format!("\n #[context({:?})]", ty_as_path(context)?)); + write!(contextattrs, "\n #[context({:?})]", ty_as_path(context)?).unwrap(); } let func_args: Vec<_> = fields .iter() |