format code

This commit is contained in:
chaos 2023-08-31 23:52:56 +01:00
parent 8f03cf4f17
commit 190f47d6ef
No known key found for this signature in database
5 changed files with 7 additions and 6 deletions

View file

@ -186,7 +186,6 @@ pub fn genhtml_command(
let file_path = std::path::PathBuf::from(genhtml_args.dest.as_str()).join("index.html"); let file_path = std::path::PathBuf::from(genhtml_args.dest.as_str()).join("index.html");
let html_index_file = std::fs::File::create(file_path); let html_index_file = std::fs::File::create(file_path);
match html_index_file { match html_index_file {
Ok(mut file) => match file.write_all(html_content.as_bytes()) { Ok(mut file) => match file.write_all(html_content.as_bytes()) {
Ok(_) => {} Ok(_) => {}

View file

@ -165,7 +165,7 @@ pub fn process_command(
for file in files.iter_mut() { for file in files.iter_mut() {
add_replaygain_tags(file, process_args.force_replaygain)?; add_replaygain_tags(file, process_args.force_replaygain)?;
} }
return Ok(()); return Ok(());
} else { } else {
let jobs: Arc<Mutex<Vec<File>>> = Arc::new(Mutex::new(files)); let jobs: Arc<Mutex<Vec<File>>> = Arc::new(Mutex::new(files));
@ -180,7 +180,7 @@ pub fn process_command(
let result = add_replaygain_tags(&job, process_args.force_replaygain); let result = add_replaygain_tags(&job, process_args.force_replaygain);
if let Err(err) = result { if let Err(err) = result {
panic!("Error doing replaygain: {}", err) panic!("Error doing replaygain: {}", err)
} }
} else { } else {
break; break;
} }

View file

@ -24,7 +24,8 @@ pub fn transcode_command(
let transcode_config = transcode_preset_or_config( let transcode_config = transcode_preset_or_config(
transcode_args.transcode_preset.as_ref(), transcode_args.transcode_preset.as_ref(),
transcode_args.transcode_config.as_ref(), transcode_args.transcode_config.as_ref(),
).expect("transcode config error"); )
.expect("transcode config error");
println!("Transcoding"); println!("Transcoding");

View file

@ -84,7 +84,8 @@ pub fn progress_monitor(
let mut watcher = RecommendedWatcher::new( let mut watcher = RecommendedWatcher::new(
tx, tx,
notify::Config::default().with_poll_interval(Duration::from_millis(100)), notify::Config::default().with_poll_interval(Duration::from_millis(100)),
).expect("could not watch for ffmpeg log progress status"); )
.expect("could not watch for ffmpeg log progress status");
watcher watcher
.watch(&file_path, RecursiveMode::NonRecursive) .watch(&file_path, RecursiveMode::NonRecursive)

View file

@ -50,7 +50,7 @@ pub fn transcode(
if let Some(sender) = &progress_sender { if let Some(sender) = &progress_sender {
let result = progress_monitor(file.join_path_to(), sender); let result = progress_monitor(file.join_path_to(), sender);
if let Ok(result) = result { if let Ok(result) = result {
progress_thread = Some(result.1); progress_thread = Some(result.1);
progress_file = Some(result.0.clone()); progress_file = Some(result.0.clone());