[2017][rust] clippy

sorbet
Alpha Chen 7 years ago
parent 6cff27d507
commit 614ff8b722

@ -5,7 +5,7 @@ pub fn solve(input: &str) -> Result<String, Error> {
let input: Vec<u32> = 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::<Result<_, _>>()?;
// 1

@ -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<String> = word.chars().map(|x| x.to_string()).collect();
@ -30,7 +30,7 @@ impl Passphrase {
return true;
}
words.insert(word);
return false;
});
false
})
}
}

Loading…
Cancel
Save