mirror of
https://github.com/bertptrs/adventofcode.git
synced 2025-12-27 05:40:32 +01:00
Fix all clippy warnings.
This commit is contained in:
@@ -25,7 +25,7 @@ impl Direction {
|
||||
_ => panic!("Invalid direction {}", c),
|
||||
}
|
||||
}
|
||||
pub fn clockwise(&self) -> Self {
|
||||
pub fn clockwise(self) -> Self {
|
||||
match self {
|
||||
Direction::North => Direction::East,
|
||||
Direction::East => Direction::South,
|
||||
@@ -34,11 +34,11 @@ impl Direction {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn counter_clockwise(&self) -> Self {
|
||||
return self.clockwise().clockwise().clockwise();
|
||||
pub fn counter_clockwise(self) -> Self {
|
||||
self.clockwise().clockwise().clockwise()
|
||||
}
|
||||
|
||||
pub fn run(&self, pos: Coordinate) -> Coordinate {
|
||||
pub fn run(self, pos: Coordinate) -> Coordinate {
|
||||
let (x, y) = pos;
|
||||
match self {
|
||||
Direction::North => (x, y - 1),
|
||||
|
||||
Reference in New Issue
Block a user