From 614ff8b722268e4d755a5ed81f1aec848b3ac5f1 Mon Sep 17 00:00:00 2001 From: Alpha Chen Date: Mon, 11 Dec 2017 13:40:34 -0800 Subject: [PATCH] [2017][rust] clippy --- 2017/rust/src/day_01.rs | 2 +- 2017/rust/src/day_04.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/2017/rust/src/day_01.rs b/2017/rust/src/day_01.rs index b526084..6431e65 100644 --- a/2017/rust/src/day_01.rs +++ b/2017/rust/src/day_01.rs @@ -5,7 +5,7 @@ pub fn solve(input: &str) -> Result { let input: Vec = input .trim() .chars() - .map(|x| x.to_digit(10).ok_or_else(|| format_err!(""))) + .map(|x| x.to_digit(10).ok_or_else(|| err_msg(""))) .collect::>()?; // 1 diff --git a/2017/rust/src/day_04.rs b/2017/rust/src/day_04.rs index df96579..3033363 100644 --- a/2017/rust/src/day_04.rs +++ b/2017/rust/src/day_04.rs @@ -18,7 +18,7 @@ struct Passphrase { impl Passphrase { fn is_valid(&self) -> bool { let mut words = HashSet::new(); - return !self.words + !self.words .split_whitespace() .map(|word| { let mut chars: Vec = word.chars().map(|x| x.to_string()).collect(); @@ -30,7 +30,7 @@ impl Passphrase { return true; } words.insert(word); - return false; - }); + false + }) } }