diff options
Diffstat (limited to 'cli/fmt.rs')
-rw-r--r-- | cli/fmt.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/cli/fmt.rs b/cli/fmt.rs index 2a8845290..d989ac1ad 100644 --- a/cli/fmt.rs +++ b/cli/fmt.rs @@ -78,13 +78,13 @@ async fn check_source_files( let _g = output_lock.lock().unwrap(); match diff(&file_text, &formatted_text) { Ok(diff) => { - println!(); - println!( + info!(""); + info!( "{} {}:", colors::bold("from"), file_path.display().to_string() ); - println!("{}", diff); + info!("{}", diff); } Err(e) => { eprintln!( @@ -113,7 +113,7 @@ async fn check_source_files( let checked_files_str = format!("{} {}", checked_files_count, files_str(checked_files_count)); if not_formatted_files_count == 0 { - println!("Checked {}", checked_files_str); + info!("Checked {}", checked_files_str); Ok(()) } else { let not_formatted_files_str = files_str(not_formatted_files_count); @@ -151,7 +151,7 @@ async fn format_source_files( )?; formatted_files_count.fetch_add(1, Ordering::Relaxed); let _g = output_lock.lock().unwrap(); - println!("{}", file_path.to_string_lossy()); + info!("{}", file_path.to_string_lossy()); } } Err(e) => { @@ -173,7 +173,7 @@ async fn format_source_files( ); let checked_files_count = checked_files_count.load(Ordering::Relaxed); - println!( + info!( "Checked {} {}", checked_files_count, files_str(checked_files_count) @@ -211,7 +211,7 @@ fn format_stdin(check: bool) -> Result<(), AnyError> { } fn files_str(len: usize) -> &'static str { - if len == 1 { + if len <= 1 { "file" } else { "files" |