fix various clippy lints from 1.57

This commit is contained in:
Antoine Martin 2021-12-04 16:55:40 +01:00
parent 239247a8c6
commit d7a77e9283
4 changed files with 6 additions and 21 deletions

View file

@ -59,7 +59,7 @@ enum Rotation {
///
/// Note: we don't need a horizontal and a vertical flip, these result in the same output as a 180
/// degree rotation when combined, so only one is necessary
#[derive(Debug, Clone, Copy)]
#[derive(Debug, Default, Clone, Copy)]
struct Transform {
flip: bool,
rotation: Option<Rotation>,
@ -121,15 +121,6 @@ impl Transform {
}
}
impl Default for Transform {
fn default() -> Self {
Self {
flip: false,
rotation: None,
}
}
}
#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq)]
enum Position {
Down,

View file

@ -133,7 +133,7 @@ fn part2(input: &str) -> Result<usize> {
/// These use the axial coordinates described here:
///
/// https://www.redblobgames.com/grids/hexagons/#coordinates-axial
#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq)]
#[derive(Debug, Default, Clone, Copy, Hash, PartialEq, Eq)]
struct HexCoordinates {
q: i64,
r: i64,
@ -188,12 +188,6 @@ impl HexCoordinates {
}
}
impl Default for HexCoordinates {
fn default() -> Self {
Self { q: 0, r: 0 }
}
}
#[cfg(test)]
mod tests {
use super::*;