This commit is contained in:
nora 2023-12-04 21:21:19 +01:00
parent 93af372574
commit b12e92a5cb
8 changed files with 238 additions and 10 deletions

View file

@ -1,11 +1,10 @@
mod cmd;
mod ext;
use std::{borrow::Cow, fmt::Debug};
use nom::{character::complete::digit1, combinator::map, IResult};
pub use self::cmd::main;
pub use divan;
pub use self::ext::*;
pub type Solution = fn(&str) -> u64;
@ -123,7 +122,7 @@ macro_rules! benchmarks {
#[macro_export]
macro_rules! _bench_sample_count {
(;$($tt:tt)*) => {
#[::divan::bench(sample_count = 10_000)]
#[::divan::bench(sample_count = 5000)]
$($tt)*
};
($sample_count:expr; $($tt:tt)*) => {
@ -209,7 +208,3 @@ macro_rules! tests {
}
};
}
pub fn integer(input: &str) -> IResult<&str, u64> {
map(digit1, |d: &str| d.parse::<u64>().unwrap())(input)
}