@@ -120,10 +120,8 @@ fn dump_trace_record(
120120 // With the exception of `> halt`, which decreases the indent (because `> entrypoint` does not
121121 // have a corresponding `< entrypoint`)
122122 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 ;
127125 }
128126 let indent_str = " " . repeat ( * indent as usize ) ;
129127 let msg = format ! ( "{}{}" , indent_str, & msg) ;
@@ -174,7 +172,7 @@ impl<T: Default> TraceTrie<T> {
174172 let mut node = self ;
175173 for frame in trace {
176174 f ( & mut node. value ) ;
177- node = ( * node) . children . entry ( * frame) . or_insert ( Self :: new ( ) )
175+ node = node. children . entry ( * frame) . or_insert ( Self :: new ( ) )
178176 }
179177 f ( & mut node. value ) ;
180178 }
@@ -185,7 +183,7 @@ struct SymbolCache {
185183 symbol_cache : HashMap < u64 , Option < ( String , Option < u32 > ) > > ,
186184}
187185impl 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 > ) > {
189187 self . symbol_cache . entry ( addr) . or_insert_with ( || {
190188 let frame = & self . loader . find_frames ( addr) . ok ( ) ?. next ( ) . ok ( ) ??;
191189 let function = frame. function . as_ref ( ) ?;
@@ -382,7 +380,7 @@ impl<R: RenderContext> ViewParams<R> {
382380 bar_start : width / 4.0 ,
383381 bar_height : 12.0 ,
384382 bar_leading : 4.0 ,
385- bar_brush : bar_brush ,
383+ bar_brush,
386384 }
387385 }
388386}
@@ -391,7 +389,7 @@ struct BarRenderer<'r> {
391389 state : & ' r mut State ,
392390 now : Duration ,
393391}
394- impl < ' r , ' a , ' s > RenderWrapper for BarRenderer < ' r > {
392+ impl < ' a , ' s > RenderWrapper for BarRenderer < ' _ > {
395393 fn render < R : RenderContext > ( & mut self , ctx : & mut R , wd : u64 , ht : u64 ) -> Option < ( ) > {
396394 let v = ViewParams :: new ( ctx, ht, wd) ;
397395 draw_bg ( ctx, & v) ;
@@ -422,7 +420,7 @@ impl<'r, 'a, 's> RenderWrapper for BarRenderer<'r> {
422420 & v,
423421 false ,
424422 ( 3 + i) as u64 ,
425- ( & mut self . state . symbol_cache ) . format_symbol ( * * site) ,
423+ self . state . symbol_cache . format_symbol ( * * site) ,
426424 * * size,
427425 self . state . total ,
428426 ) ?;
@@ -488,7 +486,7 @@ fn draw_flame<R: RenderContext>(
488486 }
489487 Some ( ( ) )
490488}
491- impl < ' r , ' a , ' s > RenderWrapper for FlameRenderer < ' r > {
489+ impl < ' a , ' s > RenderWrapper for FlameRenderer < ' _ > {
492490 fn render < R : RenderContext > ( & mut self , ctx : & mut R , wd : u64 , ht : u64 ) -> Option < ( ) > {
493491 let mut v = ViewParams :: new ( ctx, ht, wd) ;
494492 v. bar_start = v. width / 8.0 ;
@@ -745,7 +743,7 @@ fn spawn_render_thread(
745743 let mut bar_ffmpeg = ffmpeg_for ( & out_dir, Visualisation :: Bar , interval. 0 ) ?;
746744 let mut flame_ffmpeg = ffmpeg_for ( & out_dir, Visualisation :: Flame , interval. 0 ) ?;
747745 let mut job_state = State {
748- inf : inf ,
746+ inf,
749747 symbol_cache : SymbolCache {
750748 loader,
751749 symbol_cache : HashMap :: new ( ) ,
@@ -801,9 +799,9 @@ fn main() {
801799 } ;
802800 let inf = File :: open ( args[ 2 ] . clone ( ) ) . expect ( "could not open trace file" ) ;
803801 let state = State {
804- inf : inf ,
802+ inf,
805803 symbol_cache : SymbolCache {
806- loader : loader ,
804+ loader,
807805 symbol_cache : HashMap :: new ( ) ,
808806 } ,
809807 start_time : None ,
@@ -854,7 +852,6 @@ fn plot_mem(args: Vec<String>, mut state: State) {
854852 Some ( ( ) ) => ( ) ,
855853 None => {
856854 eprintln ! ( "i/o error encountered" ) ;
857- ( )
858855 }
859856 }
860857 eprintln ! ( "max total memory used is {}" , state. max_total) ;
0 commit comments