@@ -39,7 +39,7 @@ fn get_memory_usage() -> Option<MemoryStats> {
3939 } ;
4040
4141 let ( footprint_mb, dirty_mb) = Command :: new ( "footprint" )
42- . arg ( & pid. to_string ( ) )
42+ . arg ( pid. to_string ( ) )
4343 . output ( )
4444 . ok ( )
4545 . filter ( |o| o. status . success ( ) )
@@ -128,7 +128,9 @@ struct MemoryStats {
128128 resident_mb : f64 ,
129129 virtual_mb : f64 ,
130130 footprint_mb : Option < f64 > ,
131+ #[ allow( dead_code) ]
131132 dirty_mb : Option < f64 > ,
133+ #[ allow( dead_code) ]
132134 compressed_mb : Option < f64 > ,
133135}
134136
@@ -203,7 +205,7 @@ impl MemoryTracker {
203205 let current = stats. primary_metric ( ) ;
204206 let delta = current - prev_memory;
205207 let delta_str = if delta. abs ( ) > 0.5 {
206- format ! ( "{:+.1}" , delta )
208+ format ! ( "{delta :+.1}" )
207209 } else {
208210 "~0" . to_string ( )
209211 } ;
@@ -219,10 +221,10 @@ impl MemoryTracker {
219221 }
220222
221223 println ! ( "\n === Summary ===" ) ;
222- println ! ( "Duration: {:.1}s" , duration_secs ) ;
224+ println ! ( "Duration: {duration_secs :.1}s" ) ;
223225 println ! ( "Start RSS: {:.1} MB" , first. 1 . primary_metric( ) ) ;
224226 println ! ( "End RSS: {:.1} MB" , last. 1 . primary_metric( ) ) ;
225- println ! ( "Total growth: {:.1} MB" , memory_growth ) ;
227+ println ! ( "Total growth: {memory_growth :.1} MB" ) ;
226228 println ! (
227229 "Growth rate: {:.2} MB/s ({:.1} MB/10s)" ,
228230 growth_rate,
@@ -266,10 +268,10 @@ async fn run_memory_test(
266268) -> Result < ( ) , Box < dyn std:: error:: Error > > {
267269 println ! ( "=== Cap Memory Leak Detector ===\n " ) ;
268270 println ! ( "Configuration:" ) ;
269- println ! ( " Duration: {}s" , duration_secs ) ;
270- println ! ( " Camera: {}" , include_camera ) ;
271- println ! ( " Microphone: {}" , include_mic ) ;
272- println ! ( " Fragmented MP4: {}" , fragmented ) ;
271+ println ! ( " Duration: {duration_secs }s" ) ;
272+ println ! ( " Camera: {include_camera}" ) ;
273+ println ! ( " Microphone: {include_mic}" ) ;
274+ println ! ( " Fragmented MP4: {fragmented}" ) ;
273275 println ! ( ) ;
274276
275277 let mut memory_tracker = MemoryTracker :: new ( ) ;
@@ -310,7 +312,7 @@ async fn run_memory_test(
310312
311313 if include_mic {
312314 if let Some ( ( mic_name, _, _) ) = MicrophoneFeed :: default_device ( ) {
313- println ! ( "Using microphone: {}" , mic_name ) ;
315+ println ! ( "Using microphone: {mic_name}" ) ;
314316
315317 let error_sender = flume:: unbounded ( ) . 0 ;
316318 let mic_feed = MicrophoneFeed :: spawn ( MicrophoneFeed :: new ( error_sender) ) ;
@@ -373,7 +375,7 @@ async fn run_memory_test(
373375
374376 memory_tracker. sample ( ) ;
375377
376- println ! ( "Stop took: {:?}" , stop_duration ) ;
378+ println ! ( "Stop took: {stop_duration :?}" ) ;
377379 println ! ( "Output path: {}" , result. project_path. display( ) ) ;
378380
379381 memory_tracker. print_report ( ) ;
@@ -493,16 +495,13 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
493495 println ! ( "Second: Testing WITH fragmented MP4...\n " ) ;
494496 run_memory_test ( 60 , include_camera, include_mic, true ) . await ?;
495497 }
496- "help" | _ => {
498+ _ => {
497499 println ! ( "Cap Memory Leak Detector" ) ;
498500 println ! ( ) ;
499501 println ! ( "Usage: memory-leak-detector [OPTIONS]" ) ;
500502 println ! ( ) ;
501503 println ! ( "Options:" ) ;
502- println ! (
503- " --duration <secs> Test duration (default: {})" ,
504- DEFAULT_DURATION_SECS
505- ) ;
504+ println ! ( " --duration <secs> Test duration (default: {DEFAULT_DURATION_SECS})" ) ;
506505 println ! ( " --mode <mode> Test mode:" ) ;
507506 println ! ( " full Full recording pipeline with fragmented MP4 (default)" ) ;
508507 println ! ( " screen-only Screen recording only (no camera/mic)" ) ;
0 commit comments