1
Fork 0

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

This commit is contained in:
Nicholas Nethercote 2021-12-15 14:39:23 +11:00
parent 8cddcd39ba
commit 056d48a2c9
104 changed files with 189 additions and 192 deletions

View file

@ -607,7 +607,7 @@ impl CheckAttrVisitor<'tcx> {
return err_fn(meta.span(), &format!("isn't allowed on {}", err));
}
let item_name = self.tcx.hir().name(hir_id);
if &*item_name.as_str() == doc_alias {
if item_name.as_str() == doc_alias {
return err_fn(meta.span(), "is the same as the item's name");
}
let span = meta.span();
@ -636,7 +636,7 @@ impl CheckAttrVisitor<'tcx> {
LitKind::Str(s, _) => {
if !self.check_doc_alias_value(
v,
&s.as_str(),
s.as_str(),
hir_id,
target,
true,

View file

@ -1464,7 +1464,7 @@ impl<'tcx> Liveness<'_, 'tcx> {
if name == kw::Empty {
return None;
}
let name: &str = &name.as_str();
let name = name.as_str();
if name.as_bytes()[0] == b'_' {
return None;
}