diff options
| author | bors <bors@rust-lang.org> | 2021-09-02 10:27:44 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-09-02 10:27:44 +0000 |
| commit | 64929313f53181636e4dd37e25836973205477e4 (patch) | |
| tree | e519116350f0fa70340277087f46949eda1afa10 /compiler/rustc_resolve/src | |
| parent | b27ccbc7e1e6a04d749e244a3c13f72ca38e80e7 (diff) | |
| parent | 7f2df9ad65f49b916a979d819595cd1b6385bc71 (diff) | |
| download | rust-64929313f53181636e4dd37e25836973205477e4.tar.gz rust-64929313f53181636e4dd37e25836973205477e4.zip | |
Auto merge of #88516 - matthiaskrgr:clippy_perf_end_august, r=jyn514,GuillaumeGomez
some low hanging clippy::perf fixes
Diffstat (limited to 'compiler/rustc_resolve/src')
| -rw-r--r-- | compiler/rustc_resolve/src/late/diagnostics.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_resolve/src/late/lifetimes.rs | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/compiler/rustc_resolve/src/late/diagnostics.rs b/compiler/rustc_resolve/src/late/diagnostics.rs index 45657f2d0f2..d7cd34c5922 100644 --- a/compiler/rustc_resolve/src/late/diagnostics.rs +++ b/compiler/rustc_resolve/src/late/diagnostics.rs @@ -2090,7 +2090,7 @@ impl<'tcx> LifetimeContext<'_, 'tcx> { self.is_unnamed(), self.is_underscore(), self.is_named(), - sugg.starts_with("&"), + sugg.starts_with('&'), ) { (true, _, _, false) => (self.span_unnamed_borrow(), sugg), (true, _, _, true) => { diff --git a/compiler/rustc_resolve/src/late/lifetimes.rs b/compiler/rustc_resolve/src/late/lifetimes.rs index e901d4c00ab..4c1d537d55f 100644 --- a/compiler/rustc_resolve/src/late/lifetimes.rs +++ b/compiler/rustc_resolve/src/late/lifetimes.rs @@ -2605,8 +2605,10 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> { binding.ident, ); self.with(scope, |_, this| { - let scope = - Scope::Supertrait { lifetimes: lifetimes.unwrap_or(vec![]), s: this.scope }; + let scope = Scope::Supertrait { + lifetimes: lifetimes.unwrap_or_default(), + s: this.scope, + }; this.with(scope, |_, this| this.visit_assoc_type_binding(binding)); }); } else { |
