summaryrefslogtreecommitdiff
path: root/2024_rust/src/bin/day8.rs
diff options
context:
space:
mode:
authorGuillermo Ramos2024-12-14 17:53:57 +0100
committerGuillermo Ramos2024-12-14 17:53:57 +0100
commitb7bead38bfd32c0d179a7d68f362a8df82de0879 (patch)
tree754d950eafccd951e6aeaba4941b28da05180ec8 /2024_rust/src/bin/day8.rs
parent7f09510a3169c13a4f1181ff24f978d42fcf58f5 (diff)
downloadAoC-b7bead38bfd32c0d179a7d68f362a8df82de0879.tar.gz
Clippy
Diffstat (limited to '2024_rust/src/bin/day8.rs')
-rw-r--r--2024_rust/src/bin/day8.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/2024_rust/src/bin/day8.rs b/2024_rust/src/bin/day8.rs
index cbdfb77..1b18907 100644
--- a/2024_rust/src/bin/day8.rs
+++ b/2024_rust/src/bin/day8.rs
@@ -61,7 +61,7 @@ impl M {
for (_freq, antennas) in self.antennas.iter() {
// println!("Freq {freq}: {antennas:?}");
for (a1, a2) in antennas
- .into_iter()
+ .iter()
.permutations(2)
.map(|x| x.into_iter().collect_tuple().unwrap())
{
@@ -91,7 +91,7 @@ fn antinodes(a1: &matrix::Pos, a2: &matrix::Pos, limit: &matrix::Pos) -> Vec<mat
let mut a: matrix::Pos = result[0];
let mut b: matrix::Pos = result[1];
while let Some(an) = antinode(&a, &b, limit) {
- result.push(an.clone());
+ result.push(an);
a = result[result.len() - 2];
b = result[result.len() - 1];
}
@@ -113,7 +113,7 @@ fn antinode(a1: &matrix::Pos, a2: &matrix::Pos, limit: &matrix::Pos) -> Option<m
impl fmt::Display for M {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
// write!(f, "{}[2J", 27 as char)?;
- write!(f, "{}", self.matrix.to_string())
+ write!(f, "{}", self.matrix)
}
}