Skip to content

Commit 30e4e15

Browse files
committed
Tidy benchmark runner
1 parent f178be6 commit 30e4e15

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

benches/benchmark.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,14 @@ macro_rules! benchmark {
88
mod $day {
99
use aoc::$year::$day::*;
1010
use std::fs::read_to_string;
11-
use std::path::Path;
1211
use std::sync::LazyLock;
1312
use test::Bencher;
1413

1514
static DATA: LazyLock<String> = LazyLock::new(|| {
1615
let year = stringify!($year);
1716
let day = stringify!($day);
18-
let path = Path::new("input").join(year).join(day).with_extension("txt");
19-
read_to_string(path).unwrap()
17+
let path = format!("input/{year}/{day}.txt");
18+
read_to_string(&path).expect(&path)
2019
});
2120

2221
#[bench]

0 commit comments

Comments
 (0)