Remove unnecessary sigils around Symbol::as_str() calls.

This commit is contained in:
Nicholas Nethercote 2021-12-15 14:39:23 +11:00
parent b4afb38f2f
commit 3bb5f81d8d
3 changed files with 4 additions and 4 deletions

View File

@ -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,

View File

@ -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

View File

@ -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])