This commit is contained in:
Niccolo Borgioli 2023-11-19 16:51:08 +01:00
parent 9923bbe321
commit 2b5a930d3d
No known key found for this signature in database
GPG Key ID: D93C615F75EE4F0B

View File

@ -13,26 +13,34 @@ mod tests {
#[bench] #[bench]
fn bench_a(b: &mut Bencher) { fn bench_a(b: &mut Bencher) {
b.iter(|| part_a()); b.iter(|| part_a(INPUT));
} }
#[bench] #[bench]
fn bench_b(b: &mut Bencher) { fn bench_b(b: &mut Bencher) {
b.iter(|| part_b()); b.iter(|| part_b(INPUT));
} }
} }
fn part_a() { const INPUT: &str = include_str!("../input.txt");
let result = include_str!("../input.txt"); const TEST: &str = include_str!("../test.txt");
println!("A: {}", result);
fn part_a(input: &str) {
let result = input.trim();
println!("{}", result);
} }
fn part_b() { fn part_b(input: &str) {
let result = include_str!("../input.txt"); let result = input.trim();
println!("A: {}", result); println!("{}", result);
} }
fn main() { fn main() {
part_a(); println!("Part A:");
part_b(); part_a(TEST);
// part_a(INPUT);
println!("\nPart B:");
part_b(TEST);
// part_b(INPUT);
} }