diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-03-17 08:12:34 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-03-17 08:12:34 +0000 |
commit | f7fbea509f1e5f840e715c912ee38aa997d1bfbc (patch) | |
tree | 2b4932678fc83624c278ca93cdf0f1d3a28346c2 /crates/ide_db/src/defs.rs | |
parent | 6fcb5d772f16af0d1f62dad55fbde75072fb9e89 (diff) | |
parent | ff5f90d8ae2da8e4856d5c78f55e5cd02b178325 (diff) |
Merge #8063
8063: couple clippy::complexity fixes r=matklad a=matthiaskrgr
avoid redundant `.into()` calls to convert T into identical T (`let x: String = String::from("hello").into();`)
use `if let Some(x)` instead of `.is_some()` + `.unwrap()`
don't clone Copy types
remove redundant wrapped ?s: `Some(Some(3)?)` can just be `Some(3)`
use `.map(|x| y)` instead of `and_then(|x| Some(y)` on `Option`s
Co-authored-by: Matthias Krüger <[email protected]>
Diffstat (limited to 'crates/ide_db/src/defs.rs')
-rw-r--r-- | crates/ide_db/src/defs.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/ide_db/src/defs.rs b/crates/ide_db/src/defs.rs index f86e5ce93..75167ff39 100644 --- a/crates/ide_db/src/defs.rs +++ b/crates/ide_db/src/defs.rs | |||
@@ -181,7 +181,7 @@ impl NameClass { | |||
181 | }, | 181 | }, |
182 | ast::SelfParam(it) => { | 182 | ast::SelfParam(it) => { |
183 | let def = sema.to_def(&it)?; | 183 | let def = sema.to_def(&it)?; |
184 | Some(NameClass::Definition(Definition::Local(def.into()))) | 184 | Some(NameClass::Definition(Definition::Local(def))) |
185 | }, | 185 | }, |
186 | ast::RecordField(it) => { | 186 | ast::RecordField(it) => { |
187 | let field: hir::Field = sema.to_def(&it)?; | 187 | let field: hir::Field = sema.to_def(&it)?; |