aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_db/src/helpers
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-03-17 08:12:34 +0000
committerGitHub <[email protected]>2021-03-17 08:12:34 +0000
commitf7fbea509f1e5f840e715c912ee38aa997d1bfbc (patch)
tree2b4932678fc83624c278ca93cdf0f1d3a28346c2 /crates/ide_db/src/helpers
parent6fcb5d772f16af0d1f62dad55fbde75072fb9e89 (diff)
parentff5f90d8ae2da8e4856d5c78f55e5cd02b178325 (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/helpers')
-rw-r--r--crates/ide_db/src/helpers/insert_use.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/ide_db/src/helpers/insert_use.rs b/crates/ide_db/src/helpers/insert_use.rs
index df66d8ea0..9e0cb91c3 100644
--- a/crates/ide_db/src/helpers/insert_use.rs
+++ b/crates/ide_db/src/helpers/insert_use.rs
@@ -80,7 +80,7 @@ impl ImportScope {
80 }) 80 })
81 .last() 81 .last()
82 .map(|last_inner_element| { 82 .map(|last_inner_element| {
83 (InsertPosition::After(last_inner_element.into()), AddBlankLine::BeforeTwice) 83 (InsertPosition::After(last_inner_element), AddBlankLine::BeforeTwice)
84 }) 84 })
85 .unwrap_or_else(|| self.first_insert_pos()) 85 .unwrap_or_else(|| self.first_insert_pos())
86 } 86 }