File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ fn solve_part2(buttons: &[Vec<usize>], joltages: &[u64]) -> u64 {
8080 . collect ( ) ;
8181
8282 let sum = Int :: add ( & terms) ;
83- opt. assert ( & sum. eq ( & Int :: from_u64 ( jolt) ) ) ;
83+ opt. assert ( & sum. eq ( Int :: from_u64 ( jolt) ) ) ;
8484 }
8585
8686 // Constraint: t >= 0 (can't press a button negative times)
Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ use itertools::Itertools;
55advent_of_code:: solution!( 11 ) ;
66
77fn parse_input ( input : & str ) -> ( HashMap < usize , Vec < usize > > , HashMap < String , usize > ) {
8+ // convert all the ids to usize ints because borrow checker and &str don't get along
9+ // It's also almost certainly more efficient for hashing
810 let mut machine_ids = HashMap :: new ( ) ;
911 let s_to_id = move |m : String , machine_ids : & mut HashMap < String , usize > | {
1012 if let Some ( x) = machine_ids. get ( & m) {
@@ -61,6 +63,7 @@ pub fn part_one(input: &str) -> Option<u64> {
6163 Some ( total)
6264}
6365
66+ #[ allow( clippy:: too_many_arguments) ]
6467fn recurse_paths_part2 (
6568 m : usize ,
6669 end : usize ,
You can’t perform that action at this time.
0 commit comments