clippy and cleanup
This commit is contained in:
@@ -23,7 +23,7 @@ fn solve(input: &str, blinks: i32) -> usize {
|
||||
next.entry(1).and_modify(|count| *count += v).or_insert(v);
|
||||
} else if (k.ilog10() + 1) % 2 == 0 {
|
||||
let l = (k.ilog10() + 1) / 2;
|
||||
let z: usize = 10usize.pow(l as u32);
|
||||
let z: usize = 10usize.pow(l);
|
||||
let a = k / z;
|
||||
let b = k % z;
|
||||
next.entry(a).and_modify(|count| *count += v).or_insert(v);
|
||||
|
||||
12
src/day12.rs
12
src/day12.rs
@@ -91,8 +91,7 @@ fn sides(group: HashSet<(i64, i64)>) -> RiddleResult {
|
||||
.filter(|p| !group.contains(&(p.0 - 1, p.1)))
|
||||
.sorted_by_key(|p| p.1)
|
||||
.collect_vec();
|
||||
if points.is_empty() {
|
||||
} else {
|
||||
if !points.is_empty() {
|
||||
let count = points
|
||||
.into_iter()
|
||||
.tuple_windows()
|
||||
@@ -106,8 +105,7 @@ fn sides(group: HashSet<(i64, i64)>) -> RiddleResult {
|
||||
.filter(|p| !group.contains(&(p.0 + 1, p.1)))
|
||||
.sorted_by_key(|p| p.1)
|
||||
.collect_vec();
|
||||
if points.is_empty() {
|
||||
} else {
|
||||
if !points.is_empty() {
|
||||
let count = points
|
||||
.into_iter()
|
||||
.tuple_windows()
|
||||
@@ -123,8 +121,7 @@ fn sides(group: HashSet<(i64, i64)>) -> RiddleResult {
|
||||
.filter(|p| !group.contains(&(p.0, p.1 - 1)))
|
||||
.sorted_by_key(|p| p.0)
|
||||
.collect_vec();
|
||||
if points.is_empty() {
|
||||
} else {
|
||||
if !points.is_empty() {
|
||||
let count = points
|
||||
.into_iter()
|
||||
.tuple_windows()
|
||||
@@ -138,8 +135,7 @@ fn sides(group: HashSet<(i64, i64)>) -> RiddleResult {
|
||||
.filter(|p| !group.contains(&(p.0, p.1 + 1)))
|
||||
.sorted_by_key(|p| p.0)
|
||||
.collect_vec();
|
||||
if points.is_empty() {
|
||||
} else {
|
||||
if !points.is_empty() {
|
||||
let count = points
|
||||
.into_iter()
|
||||
.tuple_windows()
|
||||
|
||||
Reference in New Issue
Block a user