Prefer to_string() to format!()

This commit is contained in:
ljedrz
2018-07-27 11:11:18 +02:00
parent 3d0e93309d
commit 57a5a9b054
36 changed files with 95 additions and 95 deletions

View File

@@ -380,7 +380,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
structs, enums and unions");
if let ast::AttrStyle::Inner = attr.style {
let trait_list = traits.iter()
.map(|t| format!("{}", t)).collect::<Vec<_>>();
.map(|t| t.to_string()).collect::<Vec<_>>();
let suggestion = format!("#[derive({})]", trait_list.join(", "));
err.span_suggestion_with_applicability(
span, "try an outer attribute", suggestion,
@@ -558,7 +558,7 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
invoc.expansion_data.mark.set_expn_info(ExpnInfo {
call_site: attr.span,
def_site: None,
format: MacroAttribute(Symbol::intern(&format!("{}", attr.path))),
format: MacroAttribute(Symbol::intern(&attr.path.to_string())),
allow_internal_unstable: false,
allow_internal_unsafe: false,
local_inner_macros: false,