2020: day23: use rotate_left from VecDeque

This commit is contained in:
Antoine Martin 2020-12-24 02:06:29 +01:00
parent 022ca7daab
commit d998cb02aa

View file

@ -53,8 +53,7 @@ impl CupCircle {
/// This doesn't change anything to the cup circle layout, except that the new first cup is
/// considered the "current" cup at the end of a step in our implementation
fn shift(&mut self) {
let front = self.0.pop_front().unwrap();
self.0.push_back(front);
self.0.rotate_left(1);
}
/// Executes one step of the game