Skip to content

Commit 122e1c3

Browse files
committed
Remove unnecessary sigils around Ident::as_str() calls.
1 parent 3bb5f81 commit 122e1c3

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/items.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -616,10 +616,10 @@ impl<'a> FmtVisitor<'a> {
616616
(TyAlias(lty), TyAlias(rty))
617617
if both_type(&lty.ty, &rty.ty) || both_opaque(&lty.ty, &rty.ty) =>
618618
{
619-
a.ident.as_str().cmp(&b.ident.as_str())
619+
a.ident.as_str().cmp(b.ident.as_str())
620620
}
621621
(Const(..), Const(..)) | (MacCall(..), MacCall(..)) => {
622-
a.ident.as_str().cmp(&b.ident.as_str())
622+
a.ident.as_str().cmp(b.ident.as_str())
623623
}
624624
(Fn(..), Fn(..)) => a.span.lo().cmp(&b.span.lo()),
625625
(TyAlias(ty), _) if is_type(&ty.ty) => Ordering::Less,
@@ -1029,7 +1029,7 @@ pub(crate) fn format_trait(
10291029
if !bounds.is_empty() {
10301030
let ident_hi = context
10311031
.snippet_provider
1032-
.span_after(item.span, &item.ident.as_str());
1032+
.span_after(item.span, item.ident.as_str());
10331033
let bound_hi = bounds.last().unwrap().span().hi();
10341034
let snippet = context.snippet(mk_sp(ident_hi, bound_hi));
10351035
if contains_comment(snippet) {

src/modules.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -467,10 +467,10 @@ impl<'ast, 'sess, 'c> ModResolver<'ast, 'sess> {
467467
if let DirectoryOwnership::Owned { relative } = &mut self.directory.ownership {
468468
if let Some(ident) = relative.take() {
469469
// remove the relative offset
470-
self.directory.path.push(&*ident.as_str());
470+
self.directory.path.push(ident.as_str());
471471
}
472472
}
473-
self.directory.path.push(&*id.as_str());
473+
self.directory.path.push(id.as_str());
474474
}
475475
}
476476

src/reorder.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use crate::visitor::FmtVisitor;
2626
fn compare_items(a: &ast::Item, b: &ast::Item) -> Ordering {
2727
match (&a.kind, &b.kind) {
2828
(&ast::ItemKind::Mod(..), &ast::ItemKind::Mod(..)) => {
29-
a.ident.as_str().cmp(&b.ident.as_str())
29+
a.ident.as_str().cmp(b.ident.as_str())
3030
}
3131
(&ast::ItemKind::ExternCrate(ref a_name), &ast::ItemKind::ExternCrate(ref b_name)) => {
3232
// `extern crate foo as bar;`
@@ -44,7 +44,7 @@ fn compare_items(a: &ast::Item, b: &ast::Item) -> Ordering {
4444
(Some(..), None) => Ordering::Greater,
4545
(None, Some(..)) => Ordering::Less,
4646
(None, None) => Ordering::Equal,
47-
(Some(..), Some(..)) => a.ident.as_str().cmp(&b.ident.as_str()),
47+
(Some(..), Some(..)) => a.ident.as_str().cmp(b.ident.as_str()),
4848
}
4949
}
5050
_ => unreachable!(),

0 commit comments

Comments
 (0)