File tree 1 file changed +11
-1
lines changed
crates/divan_compat/divan_fork/src 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -315,6 +315,13 @@ impl Divan {
315
315
// Not worth doing the work of actually using the same code since this fork
316
316
// is temporary
317
317
let name = bench_entry. display_name ( ) . to_string ( ) ;
318
+ // When running with args, `bench_display_name` is the arg name
319
+ let arg_name = if bench_display_name == name {
320
+ None
321
+ } else {
322
+ Some ( bench_display_name. to_string ( ) )
323
+ } ;
324
+
318
325
let file = bench_entry. meta ( ) . location . file ;
319
326
let mut module_path = bench_entry
320
327
. meta ( )
@@ -325,7 +332,10 @@ impl Divan {
325
332
if !module_path. is_empty ( ) {
326
333
module_path. push_str ( "::" ) ;
327
334
}
328
- let uri = format ! ( "{file}::{module_path}{name}" ) ;
335
+ let mut uri = format ! ( "{file}::{module_path}{name}" ) ;
336
+ if let Some ( arg_name) = arg_name {
337
+ uri. push_str ( format ! ( "[{arg_name}]" ) . as_str ( ) ) ;
338
+ }
329
339
let iter_per_round = bench_context. samples . sample_size ;
330
340
let times_ns: Vec < _ > = bench_context
331
341
. samples
You can’t perform that action at this time.
0 commit comments