diff --git a/Cargo.toml b/Cargo.toml index 73af855..c2ad355 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ members = [ anyhow = "1.0.66" # A dead simple ANSI terminal color painting library. yansi = "1.0.0-gamma" -itertools = "0.11.0" +itertools = "0.12.0" # An implementation of regular expressions for Rust. This implementation uses finite automata … regex = "1.7.0" # Pathfinding, flow, and graph algorithms diff --git a/day1/src/lib.rs b/day1/src/lib.rs index 61b37c4..45cb56f 100644 --- a/day1/src/lib.rs +++ b/day1/src/lib.rs @@ -31,3 +31,11 @@ impl TryFrom> for Solution { Ok(solution) } } + +#[cfg(test)] +mod test { + #[test] + fn stub() { + assert_eq!(1 + 1, 2); + } +} diff --git a/template/src/lib.rs b/template/src/lib.rs index 61b37c4..0f04e01 100644 --- a/template/src/lib.rs +++ b/template/src/lib.rs @@ -31,3 +31,10 @@ impl TryFrom> for Solution { Ok(solution) } } +#[cfg(test)] +mod test { + #[test] + fn stub() { + assert_eq!(1 + 1, 2); + } +} diff --git a/utils/src/graph.rs b/utils/src/graph.rs index 8689b31..4206465 100644 --- a/utils/src/graph.rs +++ b/utils/src/graph.rs @@ -1,8 +1,10 @@ -use std::cmp::Eq; +use std::cmp::{Eq, PartialOrd}; use std::collections::{HashMap, HashSet, VecDeque}; use std::fmt::Debug; use std::hash::Hash; +use std::iter::Iterator; use std::marker::Copy; +use std::ops::Add; use tracing::debug; fn breadth_first_search_build_path<'a, N>( @@ -71,6 +73,8 @@ where None } +use tracing::debug; + pub fn dijkstra( nodes: &Vec, initial_score: IS, @@ -82,8 +86,8 @@ where GN: Fn(&N) -> NEIGH, IE: Fn(&N) -> bool, N: Debug + Eq + Copy + Hash, - R: Debug + std::cmp::PartialOrd + Copy + std::ops::Add + HasOne, - NEIGH: std::iter::Iterator, + R: Debug + PartialOrd + Copy + Add + HasOne, + NEIGH: Iterator, { let mut scores = HashMap::new(); for node in nodes {