@@ -120,10 +120,8 @@ fn dump_trace_record(
120
120
// With the exception of `> halt`, which decreases the indent (because `> entrypoint` does not
121
121
// have a corresponding `< entrypoint`)
122
122
let msg = if msg. starts_with ( '>' ) {
123
- if msg == "> halt" {
124
- if * indent > 0 {
125
- * indent -= 1 ;
126
- }
123
+ if msg == "> halt" && * indent > 0 {
124
+ * indent -= 1 ;
127
125
}
128
126
let indent_str = " " . repeat ( * indent as usize ) ;
129
127
let msg = format ! ( "{}{}" , indent_str, & msg) ;
@@ -174,7 +172,7 @@ impl<T: Default> TraceTrie<T> {
174
172
let mut node = self ;
175
173
for frame in trace {
176
174
f ( & mut node. value ) ;
177
- node = ( * node) . children . entry ( * frame) . or_insert ( Self :: new ( ) )
175
+ node = node. children . entry ( * frame) . or_insert ( Self :: new ( ) )
178
176
}
179
177
f ( & mut node. value ) ;
180
178
}
@@ -185,7 +183,7 @@ struct SymbolCache {
185
183
symbol_cache : HashMap < u64 , Option < ( String , Option < u32 > ) > > ,
186
184
}
187
185
impl SymbolCache {
188
- fn resolve_symbol < ' c > ( & ' c mut self , addr : u64 ) -> & ' c Option < ( String , Option < u32 > ) > {
186
+ fn resolve_symbol ( & mut self , addr : u64 ) -> & Option < ( String , Option < u32 > ) > {
189
187
self . symbol_cache . entry ( addr) . or_insert_with ( || {
190
188
let frame = & self . loader . find_frames ( addr) . ok ( ) ?. next ( ) . ok ( ) ??;
191
189
let function = frame. function . as_ref ( ) ?;
@@ -382,7 +380,7 @@ impl<R: RenderContext> ViewParams<R> {
382
380
bar_start : width / 4.0 ,
383
381
bar_height : 12.0 ,
384
382
bar_leading : 4.0 ,
385
- bar_brush : bar_brush ,
383
+ bar_brush,
386
384
}
387
385
}
388
386
}
@@ -391,7 +389,7 @@ struct BarRenderer<'r> {
391
389
state : & ' r mut State ,
392
390
now : Duration ,
393
391
}
394
- impl < ' r , ' a , ' s > RenderWrapper for BarRenderer < ' r > {
392
+ impl < ' a , ' s > RenderWrapper for BarRenderer < ' _ > {
395
393
fn render < R : RenderContext > ( & mut self , ctx : & mut R , wd : u64 , ht : u64 ) -> Option < ( ) > {
396
394
let v = ViewParams :: new ( ctx, ht, wd) ;
397
395
draw_bg ( ctx, & v) ;
@@ -422,7 +420,7 @@ impl<'r, 'a, 's> RenderWrapper for BarRenderer<'r> {
422
420
& v,
423
421
false ,
424
422
( 3 + i) as u64 ,
425
- ( & mut self . state . symbol_cache ) . format_symbol ( * * site) ,
423
+ self . state . symbol_cache . format_symbol ( * * site) ,
426
424
* * size,
427
425
self . state . total ,
428
426
) ?;
@@ -488,7 +486,7 @@ fn draw_flame<R: RenderContext>(
488
486
}
489
487
Some ( ( ) )
490
488
}
491
- impl < ' r , ' a , ' s > RenderWrapper for FlameRenderer < ' r > {
489
+ impl < ' a , ' s > RenderWrapper for FlameRenderer < ' _ > {
492
490
fn render < R : RenderContext > ( & mut self , ctx : & mut R , wd : u64 , ht : u64 ) -> Option < ( ) > {
493
491
let mut v = ViewParams :: new ( ctx, ht, wd) ;
494
492
v. bar_start = v. width / 8.0 ;
@@ -745,7 +743,7 @@ fn spawn_render_thread(
745
743
let mut bar_ffmpeg = ffmpeg_for ( & out_dir, Visualisation :: Bar , interval. 0 ) ?;
746
744
let mut flame_ffmpeg = ffmpeg_for ( & out_dir, Visualisation :: Flame , interval. 0 ) ?;
747
745
let mut job_state = State {
748
- inf : inf ,
746
+ inf,
749
747
symbol_cache : SymbolCache {
750
748
loader,
751
749
symbol_cache : HashMap :: new ( ) ,
@@ -801,9 +799,9 @@ fn main() {
801
799
} ;
802
800
let inf = File :: open ( args[ 2 ] . clone ( ) ) . expect ( "could not open trace file" ) ;
803
801
let state = State {
804
- inf : inf ,
802
+ inf,
805
803
symbol_cache : SymbolCache {
806
- loader : loader ,
804
+ loader,
807
805
symbol_cache : HashMap :: new ( ) ,
808
806
} ,
809
807
start_time : None ,
@@ -854,7 +852,6 @@ fn plot_mem(args: Vec<String>, mut state: State) {
854
852
Some ( ( ) ) => ( ) ,
855
853
None => {
856
854
eprintln ! ( "i/o error encountered" ) ;
857
- ( )
858
855
}
859
856
}
860
857
eprintln ! ( "max total memory used is {}" , state. max_total) ;
0 commit comments