X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Ftools%2Frustfmt%2Fsrc%2Fitems.rs;h=b7dd6b06ff8276adfdec82a2d58641606b229941;hb=940a97a91023d1817b33d0ababc985793c9ed780;hp=f36bdba26e98e91b8aecad2a4e4d433e7651596d;hpb=c0e3ddeff3596792a6d32b8aa237f2b12810c9e8;p=rust.git diff --git a/src/tools/rustfmt/src/items.rs b/src/tools/rustfmt/src/items.rs index f36bdba26e9..b7dd6b06ff8 100644 --- a/src/tools/rustfmt/src/items.rs +++ b/src/tools/rustfmt/src/items.rs @@ -616,10 +616,10 @@ fn visit_impl_items(&mut self, items: &[ptr::P]) { (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) {