diff --git a/src/items.rs b/src/items.rs index f36bdba26e98..b7dd6b06ff82 100644 --- a/src/items.rs +++ b/src/items.rs @@ -616,10 +616,10 @@ impl<'a> FmtVisitor<'a> { (TyAlias(lty), TyAlias(rty)) if both_type(<y.ty, &rty.ty) || both_opaque(<y.ty, &rty.ty) => { - a.ident.as_str().cmp(&b.ident.as_str()) + a.ident.as_str().cmp(b.ident.as_str()) } (Const(..), Const(..)) | (MacCall(..), MacCall(..)) => { - a.ident.as_str().cmp(&b.ident.as_str()) + a.ident.as_str().cmp(b.ident.as_str()) } (Fn(..), Fn(..)) => a.span.lo().cmp(&b.span.lo()), (TyAlias(ty), _) if is_type(&ty.ty) => Ordering::Less, @@ -1029,7 +1029,7 @@ pub(crate) fn format_trait( if !bounds.is_empty() { let ident_hi = context .snippet_provider - .span_after(item.span, &item.ident.as_str()); + .span_after(item.span, item.ident.as_str()); let bound_hi = bounds.last().unwrap().span().hi(); let snippet = context.snippet(mk_sp(ident_hi, bound_hi)); if contains_comment(snippet) { diff --git a/src/modules.rs b/src/modules.rs index 6cfe91c597ac..9d438a80d942 100644 --- a/src/modules.rs +++ b/src/modules.rs @@ -467,10 +467,10 @@ impl<'ast, 'sess, 'c> ModResolver<'ast, 'sess> { if let DirectoryOwnership::Owned { relative } = &mut self.directory.ownership { if let Some(ident) = relative.take() { // remove the relative offset - self.directory.path.push(&*ident.as_str()); + self.directory.path.push(ident.as_str()); } } - self.directory.path.push(&*id.as_str()); + self.directory.path.push(id.as_str()); } } diff --git a/src/reorder.rs b/src/reorder.rs index fe8e5c6b61e1..13bfc92507d0 100644 --- a/src/reorder.rs +++ b/src/reorder.rs @@ -26,7 +26,7 @@ use crate::visitor::FmtVisitor; fn compare_items(a: &ast::Item, b: &ast::Item) -> Ordering { match (&a.kind, &b.kind) { (&ast::ItemKind::Mod(..), &ast::ItemKind::Mod(..)) => { - a.ident.as_str().cmp(&b.ident.as_str()) + a.ident.as_str().cmp(b.ident.as_str()) } (&ast::ItemKind::ExternCrate(ref a_name), &ast::ItemKind::ExternCrate(ref b_name)) => { // `extern crate foo as bar;` @@ -44,7 +44,7 @@ fn compare_items(a: &ast::Item, b: &ast::Item) -> Ordering { (Some(..), None) => Ordering::Greater, (None, Some(..)) => Ordering::Less, (None, None) => Ordering::Equal, - (Some(..), Some(..)) => a.ident.as_str().cmp(&b.ident.as_str()), + (Some(..), Some(..)) => a.ident.as_str().cmp(b.ident.as_str()), } } _ => unreachable!(),