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/src/syntax_highlighting | |
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/src/syntax_highlighting')
-rw-r--r-- | crates/ide/src/syntax_highlighting/inject.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/ide/src/syntax_highlighting/inject.rs b/crates/ide/src/syntax_highlighting/inject.rs index 8cdc3688f..4f825523c 100644 --- a/crates/ide/src/syntax_highlighting/inject.rs +++ b/crates/ide/src/syntax_highlighting/inject.rs | |||
@@ -56,7 +56,7 @@ pub(super) fn ra_fixture( | |||
56 | for range in inj.map_range_up(hl_range.range) { | 56 | for range in inj.map_range_up(hl_range.range) { |
57 | if let Some(range) = literal.map_range_up(range) { | 57 | if let Some(range) = literal.map_range_up(range) { |
58 | hl_range.range = range; | 58 | hl_range.range = range; |
59 | hl.add(hl_range.clone()); | 59 | hl.add(hl_range); |
60 | } | 60 | } |
61 | } | 61 | } |
62 | } | 62 | } |