From d493a4476c2059924d032fbf01dda091601f9667 Mon Sep 17 00:00:00 2001 From: Alan Du Date: Tue, 16 Oct 2018 11:51:58 -0400 Subject: clippy: Use if lets and remove redundant returns --- crates/ra_syntax/src/grammar/patterns.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'crates/ra_syntax/src/grammar/patterns.rs') diff --git a/crates/ra_syntax/src/grammar/patterns.rs b/crates/ra_syntax/src/grammar/patterns.rs index 9d35dbb3d..10fa0e0be 100644 --- a/crates/ra_syntax/src/grammar/patterns.rs +++ b/crates/ra_syntax/src/grammar/patterns.rs @@ -49,9 +49,8 @@ fn atom_pat(p: &mut Parser, recovery_set: TokenSet) -> Option { // "hello" => (), // } // } - match expressions::literal(p) { - Some(m) => return Some(m), - None => (), + if let Some(m) = expressions::literal(p) { + return Some(m); } let m = match la0 { -- cgit v1.2.3