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/tools/src/main.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'crates/tools') diff --git a/crates/tools/src/main.rs b/crates/tools/src/main.rs index 152298014..fdb443690 100644 --- a/crates/tools/src/main.rs +++ b/crates/tools/src/main.rs @@ -112,9 +112,8 @@ fn existing_tests(dir: &Path) -> Result> { name: name.clone(), text, }; - match res.insert(name, (path, test)) { - Some(old) => println!("Duplicate test: {:?}", old), - None => (), + if let Some(old) = res.insert(name, (path, test)) { + println!("Duplicate test: {:?}", old); } } Ok(res) -- cgit v1.2.3