From 2ec0a5ba7a5c8c668aa75f20e0584db566abadc0 Mon Sep 17 00:00:00 2001 From: Avril Date: Sun, 4 Dec 2022 16:09:14 +0000 Subject: [PATCH] Changed `full` to smallmap::Set since BTreeSet since we aren"t doing part2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fortune for day3's current commit: Middle blessing − 中吉 --- day3/src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/day3/src/main.rs b/day3/src/main.rs index 7aec75a..6c52d37 100644 --- a/day3/src/main.rs +++ b/day3/src/main.rs @@ -31,11 +31,11 @@ fn init() -> eyre::Result<()> color_eyre::install() } -#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)] +#[derive(Debug, Clone, PartialEq, Eq)] //TODO: implement PartialEq, Eq, PartialOrd, Ord via intersection between `full`s struct Sack { split_by: usize, containers: Vec>, - full: BTreeSet, + full: smallmap::Set, //TODO: When doing the above ^, change to BTreeSet for `intersection()` } impl Sack @@ -80,7 +80,7 @@ impl std::str::FromStr for Sack first.chars().collect(), second.chars().collect(), ], - full: s.chars().collect(), + full: s.chars().map(|a| (a, ())).collect(), }) } }