diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2021-12-15 16:13:11 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2021-12-15 17:32:42 +1100 |
| commit | b1c934ebb8b881977a93c05c15caa88921792d3b (patch) | |
| tree | 181fbc5557c36965dedd37bb2931a06e6deb8647 /compiler/rustc_resolve | |
| parent | 056d48a2c97860b2cce936f310331e606076fa01 (diff) | |
| download | rust-b1c934ebb8b881977a93c05c15caa88921792d3b.tar.gz rust-b1c934ebb8b881977a93c05c15caa88921792d3b.zip | |
Remove unnecessary sigils around `Ident::as_str()` calls.
Diffstat (limited to 'compiler/rustc_resolve')
| -rw-r--r-- | compiler/rustc_resolve/src/diagnostics.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_resolve/src/late/diagnostics.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_resolve/src/macros.rs | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_resolve/src/diagnostics.rs b/compiler/rustc_resolve/src/diagnostics.rs index 70e0ca0f5c8..babfa8015af 100644 --- a/compiler/rustc_resolve/src/diagnostics.rs +++ b/compiler/rustc_resolve/src/diagnostics.rs @@ -1185,7 +1185,7 @@ impl<'a> Resolver<'a> { ("", " from prelude") } else if b.is_extern_crate() && !b.is_import() - && self.session.opts.externs.get(&ident.as_str()).is_some() + && self.session.opts.externs.get(ident.as_str()).is_some() { ("", " passed with `--extern`") } else if add_built_in { diff --git a/compiler/rustc_resolve/src/late/diagnostics.rs b/compiler/rustc_resolve/src/late/diagnostics.rs index 4254f3239f8..f765e7bf1c0 100644 --- a/compiler/rustc_resolve/src/late/diagnostics.rs +++ b/compiler/rustc_resolve/src/late/diagnostics.rs @@ -231,7 +231,7 @@ impl<'a: 'ast, 'ast> LateResolutionVisitor<'a, '_, 'ast> { let is_assoc_fn = self.self_type_is_available(span); // Emit help message for fake-self from other languages (e.g., `this` in Javascript). - if ["this", "my"].contains(&&*item_str.as_str()) && is_assoc_fn { + if ["this", "my"].contains(&item_str.as_str()) && is_assoc_fn { err.span_suggestion_short( span, "you might have meant to use `self` here instead", @@ -1372,7 +1372,7 @@ impl<'a: 'ast, 'ast> LateResolutionVisitor<'a, '_, 'ast> { fn likely_rust_type(path: &[Segment]) -> Option<Symbol> { let name = path[path.len() - 1].ident.as_str(); // Common Java types - Some(match &*name { + Some(match name { "byte" => sym::u8, // In Java, bytes are signed, but in practice one almost always wants unsigned bytes. "short" => sym::i16, "boolean" => sym::bool, diff --git a/compiler/rustc_resolve/src/macros.rs b/compiler/rustc_resolve/src/macros.rs index 28dbce0471e..52685ec697c 100644 --- a/compiler/rustc_resolve/src/macros.rs +++ b/compiler/rustc_resolve/src/macros.rs @@ -105,7 +105,7 @@ fn fast_print_path(path: &ast::Path) -> Symbol { path_str.push_str("::"); } if segment.ident.name != kw::PathRoot { - path_str.push_str(&segment.ident.as_str()) + path_str.push_str(segment.ident.as_str()) } } Symbol::intern(&path_str) |
