From d95c567319162f26c1ecca42b7ba38f35529b967 Mon Sep 17 00:00:00 2001 From: Dylan Thies Date: Tue, 12 Dec 2023 00:22:07 -0500 Subject: [PATCH] cleanup --- 2023/day-7/Cargo.toml | 4 ++++ 2023/day-7/src/main.rs | 7 +++++++ template/day-n/Cargo.toml | 4 ++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/2023/day-7/Cargo.toml b/2023/day-7/Cargo.toml index d38efff..f7b1dde 100644 --- a/2023/day-7/Cargo.toml +++ b/2023/day-7/Cargo.toml @@ -12,3 +12,7 @@ nom.workspace = true itertools.workspace = true num = "0.4.1" num-traits = "0.2.17" +dhat = { workspace = true } + +[features] +dhat-heap = [] diff --git a/2023/day-7/src/main.rs b/2023/day-7/src/main.rs index 3fe2cc5..49a21b9 100644 --- a/2023/day-7/src/main.rs +++ b/2023/day-7/src/main.rs @@ -1,9 +1,16 @@ #![warn(clippy::all, clippy::pedantic)] +#[cfg(feature = "dhat-heap")] +#[global_allocator] +static ALLOC: dhat::Alloc = dhat::Alloc; + use day_7::part1; use day_7::part2; fn main() { + #[cfg(feature = "dhat-heap")] + let _profiler = dhat::Profiler::new_heap(); + let input = include_str!("./input.txt"); let part1_result = part1(input); println!("part 1: {part1_result}"); diff --git a/template/day-n/Cargo.toml b/template/day-n/Cargo.toml index d4d312e..ab03958 100644 --- a/template/day-n/Cargo.toml +++ b/template/day-n/Cargo.toml @@ -8,5 +8,5 @@ repository.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -nom.workspace = true -itertools.workspace = true +nom = { workspace = true } +itertools = {workspace = true ]