Update to new itertools version

This commit is contained in:
2019-02-18 15:08:36 +01:00
parent ec6a14a43b
commit 171d9fa2e9
2 changed files with 3 additions and 3 deletions

View File

@@ -8,7 +8,7 @@ description = "Implementation of the problems of Advent of Code 2018"
clap = "2.32" clap = "2.32"
regex = "1.1.0" regex = "1.1.0"
chrono = "0.4.6" chrono = "0.4.6"
itertools = "0.7.11" itertools = "0.8"
[dev-dependencies] [dev-dependencies]
bencher = "0.1.5" bencher = "0.1.5"

View File

@@ -68,14 +68,14 @@ impl Day10 {
} }
fn height(&self) -> i32 { fn height(&self) -> i32 {
match self.points.iter().skip(1).step(2).minmax() { match self.points.iter().skip(1).step_by(2).minmax() {
MinMaxResult::MinMax(x, y) => { y - x + 1 } MinMaxResult::MinMax(x, y) => { y - x + 1 }
_ => panic!("Input does not make sense."), _ => panic!("Input does not make sense."),
} }
} }
fn underestimate_time(&self) -> i32 { fn underestimate_time(&self) -> i32 {
let (lower, upper) = match self.points.iter().enumerate().skip(1).step(2).minmax_by_key(|&(_, y)| y) { let (lower, upper) = match self.points.iter().enumerate().skip(1).step_by(2).minmax_by_key(|&(_, y)| y) {
MinMaxResult::MinMax((x, _), (y, _)) => (x, y), MinMaxResult::MinMax((x, _), (y, _)) => (x, y),
_ => panic!("Input does not make sense"), _ => panic!("Input does not make sense"),
}; };