2020: day23: use rotate_left from VecDeque
This commit is contained in:
parent
022ca7daab
commit
d998cb02aa
|
@ -53,8 +53,7 @@ impl CupCircle {
|
||||||
/// This doesn't change anything to the cup circle layout, except that the new first cup is
|
/// 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
|
/// considered the "current" cup at the end of a step in our implementation
|
||||||
fn shift(&mut self) {
|
fn shift(&mut self) {
|
||||||
let front = self.0.pop_front().unwrap();
|
self.0.rotate_left(1);
|
||||||
self.0.push_back(front);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Executes one step of the game
|
/// Executes one step of the game
|
||||||
|
|
Loading…
Reference in a new issue