From 3bb5f81d8d818ffd506ead1d08996d60e05bba07 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Wed, 15 Dec 2021 14:39:23 +1100 Subject: [PATCH] Remove unnecessary sigils around `Symbol::as_str()` calls. --- src/attr.rs | 4 ++-- src/modules.rs | 2 +- src/utils.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/attr.rs b/src/attr.rs index 76b66e9da809..3887a8051f20 100644 --- a/src/attr.rs +++ b/src/attr.rs @@ -337,7 +337,7 @@ impl Rewrite for ast::Attribute { } else { let should_skip = self .ident() - .map(|s| context.skip_context.skip_attribute(&s.name.as_str())) + .map(|s| context.skip_context.skip_attribute(s.name.as_str())) .unwrap_or(false); let prefix = attr_prefix(self); @@ -356,7 +356,7 @@ impl Rewrite for ast::Attribute { let literal_str = literal.as_str(); let doc_comment_formatter = - DocCommentFormatter::new(&*literal_str, comment_style); + DocCommentFormatter::new(literal_str, comment_style); let doc_comment = format!("{}", doc_comment_formatter); return rewrite_doc_comment( &doc_comment, diff --git a/src/modules.rs b/src/modules.rs index b1f229d9daaf..6cfe91c597ac 100644 --- a/src/modules.rs +++ b/src/modules.rs @@ -455,7 +455,7 @@ impl<'ast, 'sess, 'c> ModResolver<'ast, 'sess> { fn push_inline_mod_directory(&mut self, id: symbol::Ident, attrs: &[ast::Attribute]) { if let Some(path) = find_path_value(attrs) { - self.directory.path.push(&*path.as_str()); + self.directory.path.push(path.as_str()); self.directory.ownership = DirectoryOwnership::Owned { relative: None }; } else { // We have to push on the current module name in the case of relative diff --git a/src/utils.rs b/src/utils.rs index 3a8713c5bdb0..0c0b789a6efd 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -260,7 +260,7 @@ fn is_skip(meta_item: &MetaItem) -> bool { match meta_item.kind { MetaItemKind::Word => { let path_str = pprust::path_to_string(&meta_item.path); - path_str == *skip_annotation().as_str() || path_str == *depr_skip_annotation().as_str() + path_str == skip_annotation().as_str() || path_str == depr_skip_annotation().as_str() } MetaItemKind::List(ref l) => { meta_item.has_name(sym::cfg_attr) && l.len() == 2 && is_skip_nested(&l[1])