diff options
-rw-r--r-- | src/main.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs index e97fd2c..fb203a7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,7 +16,11 @@ use clap::CommandFactory; use context::{layout, Context}; use progress::{Indicator, IndicatorHandle, Message}; use render::{Engine, Flat, FlatInverted, Inverted, Regular}; -use std::{error::Error, io::stdout, process::ExitCode}; +use std::{ + error::Error, + io::{stdout, Write}, + process::ExitCode, +}; use tree::Tree; /// Operations to wrangle ANSI escaped strings. @@ -114,13 +118,13 @@ fn run() -> Result<(), Box<dyn Error>> { #[cfg(debug_assertions)] { if std::env::var_os("ERDTREE_DEBUG").is_none() { - println!("{output}"); + let _ = writeln!(stdout(), "{output}"); } } #[cfg(not(debug_assertions))] { - println!("{output}"); + let _ = writeln!(stdout(), "{output}"); } Ok(()) |