From c5470de9ea62e6db3e804c8283c1ea85e51b0edb Mon Sep 17 00:00:00 2001 From: Lars Martens Date: Thu, 7 Dec 2023 18:01:35 +0100 Subject: [PATCH] Time runs --- justfile | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/justfile b/justfile index 5cf60a6..60aaecf 100644 --- a/justfile +++ b/justfile @@ -6,23 +6,21 @@ year := "2023" file := "src/bin/" + day + ".rs" # Format, lint, and run the program for today. -run: _output-folder - rustfmt src/bin/{{day}}.rs +run: cargo clippy # Hide warning here because we just ran clippy - RUSTFLAGS=-Awarnings cargo run --release --bin {{day}} + RUSTFLAGS=-Awarnings cargo build --release --bin {{day}} + time ./target/release/{{day}} # Begin working on todays problem. Downloads input, creates template and opens the problem and code. begin: _input-folder - echo "use aoc2023::*; const INPUT: &str = include_str!(\"../../input/{{day}}\"); const TEST_INPUT: &str = include_str!(\"../../input/{{day}}-test\"); fn main() {}" >> {{file}} + echo "const INPUT: &str = include_str!(\"../../input/{{day}}\"); const TEST_INPUT: &str = include_str!(\"../../input/{{day}}-test\"); fn main() {}" >> {{file}} rustfmt {{file}} curl --silent "https://adventofcode.com/{{year}}/day/{{dayWithout0}}/input" -H "Cookie: session=$AOC_SESSION" > "input/{{day}}" touch input/{{day}}-test rustrover {{file}} + rustrover input/{{day}}-test open "https://adventofcode.com/{{year}}/day/{{dayWithout0}}" -_output-folder: - mkdir -p output - _input-folder: mkdir -p input