]> git.nihav.org Git - nihav-encoder.git/commitdiff
remove useless &format!("const string") in debug log master
authorKostya Shishkov <kostya.shishkov@gmail.com>
Mon, 2 Mar 2026 17:49:16 +0000 (18:49 +0100)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Mon, 2 Mar 2026 17:49:16 +0000 (18:49 +0100)
src/main.rs
src/transcoder.rs

index a3be91c452841334daea85202a107c5bc1db527a..f9b8ab0c118ceb8be440f7bec5f6f32e9342c62e 100644 (file)
@@ -441,12 +441,12 @@ fn main() {
 
     if transcoder.input_name.iter().flatten().count() == 0 {
         println!("no input name(s) provided");
-        transcoder.debug_log(DebugLog::GENERAL, &format!("no input name(s) provided"));
+        transcoder.debug_log(DebugLog::GENERAL, "no input name(s) provided");
         return;
     }
     if transcoder.output_name.is_empty() {
         println!("no output name provided");
-        transcoder.debug_log(DebugLog::GENERAL, &format!("no output name provided"));
+        transcoder.debug_log(DebugLog::GENERAL, "no output name provided");
         return;
     }
 
@@ -561,7 +561,7 @@ fn main() {
             }
             fmtname
         } else if transcoder.output_name.as_str() == "/dev/null" {
-            transcoder.debug_log(DebugLog::MUX, &format!("Using null muxer"));
+            transcoder.debug_log(DebugLog::MUX, "Using null muxer");
             "null"
         } else if let Some(fmtname) = detect::detect_format_by_name(transcoder.output_name.as_str()) {
             transcoder.debug_log(DebugLog::MUX, &format!("Detected muxer format as {fmtname}"));
@@ -583,7 +583,7 @@ fn main() {
 
     if custom_profile && !profile_name.is_empty() {
         println!("profile setting is incompatible with custom --ostream options");
-        transcoder.debug_log(DebugLog::GENERAL, &format!("profile setting is incompatible with custom --ostream options"));
+        transcoder.debug_log(DebugLog::GENERAL, "profile setting is incompatible with custom --ostream options");
         return;
     }
     if !profile_name.is_empty() {
@@ -608,7 +608,7 @@ fn main() {
     transcoder.queue.set_sync(force_sync || !mux_quirks.is_unsync());
 
     if transcoder.calc_len {
-        transcoder.debug_log(DebugLog::GENERAL, &format!("Calculating total length of input streams"));
+        transcoder.debug_log(DebugLog::GENERAL, "Calculating total length of input streams");
 
         let mut sids = Vec::new();
         transcoder.nframes.clear();
@@ -636,7 +636,7 @@ fn main() {
         demuxers.clear();
         if !transcoder.create_demuxers(&mut demuxers, &full_reg, false) {
             println!("failed to re-create demuxer(s)");
-            transcoder.debug_log(DebugLog::GENERAL, &format!("failed to re-create demuxer(s)"));
+            transcoder.debug_log(DebugLog::GENERAL, "failed to re-create demuxer(s)");
             return;
         }
     }
@@ -645,7 +645,7 @@ fn main() {
     let mut out_sm = StreamManager::new();
     if !transcoder.negotiate_stream_map(&ism, mux_caps, &mut out_sm, &full_reg.enc_reg) {
         println!("cannot determine stream map");
-        transcoder.debug_log(DebugLog::GENERAL, &format!("cannot determine stream map"));
+        transcoder.debug_log(DebugLog::GENERAL, "cannot determine stream map");
         return;
     }
 
@@ -810,7 +810,7 @@ fn main() {
             break;
         }
     }
-    transcoder.debug_log(DebugLog::GENERAL, &format!("Demuxing done, flushing leftover frames"));
+    transcoder.debug_log(DebugLog::GENERAL, "Demuxing done, flushing leftover frames");
     'reord_flush_loop: for stream in ism.iter() {
         let src_id = stream.get_num();
         if let OutputMode::Encode(dst_id, ref mut encoder) = transcoder.encoders[src_id] {
@@ -834,7 +834,7 @@ fn main() {
             }
         }
     }
-    transcoder.debug_log(DebugLog::GENERAL, &format!("Flushing encoders"));
+    transcoder.debug_log(DebugLog::GENERAL, "Flushing encoders");
     /*'flush_loop:*/ for enc in transcoder.encoders.iter_mut() {
         match enc {
             OutputMode::Encode(str_id, ref mut encoder) => {
@@ -851,14 +851,14 @@ fn main() {
         };
     }
 
-    transcoder.debug_log(DebugLog::GENERAL, &format!("Flushing encoded packets"));
+    transcoder.debug_log(DebugLog::GENERAL, "Flushing encoded packets");
     retrieve_packets(&mut transcoder, &mut mux, &mut vdata_size, &mut adata_size, true);
 
     if transcoder.verbose > 0 {
         println!();
     }
 
-    transcoder.debug_log(DebugLog::MUX, &format!("Finalising muxing"));
+    transcoder.debug_log(DebugLog::MUX, "Finalising muxing");
     let ret = mux.end();
     if ret.is_err() {
         println!("error at finalising muxing");
index dbbe160e4c9811c0a3a34c634cd3103464d91a55..ca82c99fb960c3dd1d64183c1af52cb3beff2935 100644 (file)
@@ -467,7 +467,7 @@ impl OutputQueue {
             }
             if self.cur_stream == last_str {
                 if let Some(ref mut dlog) = dbg {
-                    dlog.log(DebugLog::SYNC, &format!(" sync: no packets to output"));
+                    dlog.log(DebugLog::SYNC, " sync: no packets to output");
                 }
                 break;
             }
@@ -1320,7 +1320,7 @@ println!("encoder {} is not supported by output (expected {})", istr.id, istr.ge
                         println!();
                         println!("cannot create demuxer");
                         if let Some(ref mut dbg) = self.debug {
-                            dbg.log(DebugLog::DEMUX, &format!("demuxer creation failed"));
+                            dbg.log(DebugLog::DEMUX, "demuxer creation failed");
                         }
                         return false;
                     }