Skip to content

Commit 9e4e9e4

Browse files
feat(divan_compat): put args between brackets in bench URI
1 parent 3ec23f2 commit 9e4e9e4

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

crates/divan_compat/src/compat/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ pub fn main() {
4848
let bench_runner = bench_runner();
4949

5050
for (arg_index, arg_name) in bench_runner.arg_names().iter().enumerate() {
51-
let entry_name_with_arg = format!("{}::{}", entry_uri, arg_name);
52-
let bencher = bench::Bencher::new(entry_name_with_arg);
51+
let uri_with_arg = uri::append_arg(entry_uri.as_str(), arg_name);
52+
let bencher = bench::Bencher::new(uri_with_arg);
5353

5454
bench_runner.bench(bencher, arg_index);
5555
}

crates/divan_compat/src/compat/uri.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,7 @@ pub(crate) fn generate(
1717

1818
uri
1919
}
20+
21+
pub(crate) fn append_arg(uri: &str, arg: &str) -> String {
22+
format!("{uri}[{arg}]")
23+
}

0 commit comments

Comments
 (0)