aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src/handlers/move_guard.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-02-18 14:37:34 +0000
committerGitHub <[email protected]>2020-02-18 14:37:34 +0000
commitcecf25b72f2af84fc1535cf52d6f3c1b52802565 (patch)
tree37c8dde0a459caacae6629da08d86be270469ef5 /crates/ra_assists/src/handlers/move_guard.rs
parenteab80cd961919b9321e1d34343ae3f3adb0502e5 (diff)
parentf6816c253b96e8436f1156d6bd6b0942ee9fb4d3 (diff)
Merge #3220
3220: Fix clippy warnings, update Cargo.toml versions r=matklad a=SomeoneToIgnore In the `cargo xtask lint` ouptut, there were two interesting Clippy warnings that might be interesting to investigate further: * warning: this argument (4 byte) is passed by reference, but would be more efficient if passed by value (limit: 8 byte) * warning: large size difference between variants Co-authored-by: Kirill Bulatov <[email protected]>
Diffstat (limited to 'crates/ra_assists/src/handlers/move_guard.rs')
-rw-r--r--crates/ra_assists/src/handlers/move_guard.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_assists/src/handlers/move_guard.rs b/crates/ra_assists/src/handlers/move_guard.rs
index a61a2ba3e..1cc498638 100644
--- a/crates/ra_assists/src/handlers/move_guard.rs
+++ b/crates/ra_assists/src/handlers/move_guard.rs
@@ -44,7 +44,7 @@ pub(crate) fn move_guard_to_arm_body(ctx: AssistCtx) -> Option<Assist> {
44 edit.target(guard.syntax().text_range()); 44 edit.target(guard.syntax().text_range());
45 let offseting_amount = match space_before_guard.and_then(|it| it.into_token()) { 45 let offseting_amount = match space_before_guard.and_then(|it| it.into_token()) {
46 Some(tok) => { 46 Some(tok) => {
47 if let Some(_) = ast::Whitespace::cast(tok.clone()) { 47 if ast::Whitespace::cast(tok.clone()).is_some() {
48 let ele = tok.text_range(); 48 let ele = tok.text_range();
49 edit.delete(ele); 49 edit.delete(ele);
50 ele.len() 50 ele.len()
@@ -98,11 +98,11 @@ pub(crate) fn move_arm_cond_to_match_guard(ctx: AssistCtx) -> Option<Assist> {
98 let then_block = if_expr.then_branch()?; 98 let then_block = if_expr.then_branch()?;
99 99
100 // Not support if with else branch 100 // Not support if with else branch
101 if let Some(_) = if_expr.else_branch() { 101 if if_expr.else_branch().is_some() {
102 return None; 102 return None;
103 } 103 }
104 // Not support moving if let to arm guard 104 // Not support moving if let to arm guard
105 if let Some(_) = cond.pat() { 105 if cond.pat().is_some() {
106 return None; 106 return None;
107 } 107 }
108 108