From 18c6481fffc9b32ec2457d363454d2a37dc6badb Mon Sep 17 00:00:00 2001 From: "Aode (lion)" Date: Sun, 29 Aug 2021 14:16:55 -0500 Subject: [PATCH] Print outfile when converting / processing --- src/magick.rs | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/magick.rs b/src/magick.rs index 4f239c4..5c12351 100644 --- a/src/magick.rs +++ b/src/magick.rs @@ -43,9 +43,12 @@ where P1: AsRef, P2: AsRef, { - let mut output_file = std::ffi::OsString::new(); - output_file.extend([format.to_magick_format().as_ref(), ":".as_ref()]); - output_file.extend([to.as_ref().as_ref()]); + let format = format!("{}:", format.to_magick_format()); + + let mut output_file = std::ffi::OsString::from(format); + output_file.push(to.as_ref()); + + tracing::debug!("Outfile: {:?}", output_file); let permit = semaphore().acquire().await?; @@ -81,7 +84,6 @@ where drop(permit); let s = String::from_utf8_lossy(&output.stdout); - tracing::debug!("lines: {}", s); let mut lines = s.lines(); let first = lines.next().ok_or_else(|| MagickError::Format)?; @@ -169,9 +171,12 @@ where P1: AsRef, P2: AsRef, { - let mut output_file = std::ffi::OsString::new(); - output_file.extend([format!("{}:", format.to_magick_format()).as_ref()]); - output_file.extend([output.as_ref().as_ref()]); + let format = format!("{}:", format.to_magick_format()); + + let mut output_file = std::ffi::OsString::from(format); + output_file.push(output.as_ref()); + + tracing::debug!("Outfile: {:?}", output_file); let permit = semaphore().acquire().await?;