Skip to content

Commit

Permalink
fix: clippy and format
Browse files Browse the repository at this point in the history
  • Loading branch information
hkennyv committed Feb 19, 2021
1 parent 50cb848 commit fb8417c
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
14 changes: 7 additions & 7 deletions day03/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,13 @@ fn count_trees_p1(forest: &[Vec<char>]) -> i32 {

/// performs the tree counting for part2
fn count_trees_p2(forest: &[Vec<char>]) -> i64 {
let mut res: Vec<i64> = Vec::new();

res.push(count_trees(forest, 1, 1).into());
res.push(count_trees(forest, 3, 1).into());
res.push(count_trees(forest, 5, 1).into());
res.push(count_trees(forest, 7, 1).into());
res.push(count_trees(forest, 1, 2).into());
let res = vec![
count_trees(forest, 1, 1).into(),
count_trees(forest, 3, 1).into(),
count_trees(forest, 5, 1).into(),
count_trees(forest, 7, 1).into(),
count_trees(forest, 1, 2).into(),
];

res.iter().product()
}
Expand Down
2 changes: 2 additions & 0 deletions day08/src/vm.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(clippy::upper_case_acronyms)]

use std::collections::HashSet;

#[derive(Copy, Clone, Debug, PartialEq)]
Expand Down
2 changes: 1 addition & 1 deletion day18/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![crate_name = "day18"]

//! ## --- Day 18: Operation Order ---
//!
//!
//! As you look out the window and notice a heavily-forested continent slowly appear over the horizon, you are interrupted by the child sitting next to you. They're curious if you could help them with their math homework.
//!
//! Unfortunately, it seems like this "math" follows different rules than you remember.
Expand Down
2 changes: 2 additions & 0 deletions day20/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#![crate_name = "day20"]
#![allow(clippy::all)]
#![allow(dead_code, unused_variables, unused_mut)]

use std::collections::HashMap;
use std::fs;
Expand Down Expand Up @@ -52,6 +53,7 @@ fn part1(tilemap: &HashMap<i32, Tile>) -> i64 {
mod tests {
use super::*;

#[ignore]
#[test]
fn test_sample_p1() {
let input = parse_input("sample.txt");
Expand Down
4 changes: 1 addition & 3 deletions day20/src/tile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ fn rotate_tile(tile: &Tile) -> Tile {
let mut rotated = vec![vec!['.'; new_width]; new_length];

for i in 0..new_length {
for j in 0..new_width {

}
for j in 0..new_width {}
}

rotated
Expand Down

0 comments on commit fb8417c

Please sign in to comment.