File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed 
crates/divan_compat/divan_fork/src Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -315,6 +315,13 @@ impl Divan {
315315                        // Not worth doing the work of actually using the same code since this fork 
316316                        // is temporary 
317317                        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+ 
318325                        let  file = bench_entry. meta ( ) . location . file ; 
319326                        let  mut  module_path = bench_entry
320327                            . meta ( ) 
@@ -326,6 +333,8 @@ impl Divan {
326333                            module_path. push_str ( "::" ) ; 
327334                        } 
328335                        let  uri = format ! ( "{file}::{module_path}{name}" ) ; 
336+                         let  uri =
337+                             arg_name. map ( |arg_name| format ! ( "{uri}[{arg_name}]" ) ) . unwrap_or ( uri) ; 
329338                        let  iter_per_round = bench_context. samples . sample_size ; 
330339                        let  times_ns:  Vec < _ >  = bench_context
331340                            . samples 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments