diff --git a/2016/src/day21.rs b/2016/src/day21.rs index aedbb32..570a649 100644 --- a/2016/src/day21.rs +++ b/2016/src/day21.rs @@ -1,5 +1,4 @@ use common; -use itertools::Itertools; use std::io::prelude::*; use std::io::BufReader; @@ -36,10 +35,7 @@ impl Day21 { fn find(&self, search: &str) -> usize { let c = search.chars().next().unwrap(); - match self.password.iter().find_position(|&&x| x == c) { - Some((pos, _)) => pos, - _ => panic!("Char not in password: {}", c) - } + self.password.iter().position(|&x| x == c).unwrap() } fn reverse_range(&mut self, pos_1: usize, pos_2: usize)