diff options
| -rw-r--r-- | mingling/src/program.rs | 15 | ||||
| -rw-r--r-- | mingling/src/program/config.rs | 4 | ||||
| -rw-r--r-- | mingling/src/program/exec/error.rs | 4 |
3 files changed, 11 insertions, 12 deletions
diff --git a/mingling/src/program.rs b/mingling/src/program.rs index 9463084..22488ba 100644 --- a/mingling/src/program.rs +++ b/mingling/src/program.rs @@ -65,15 +65,14 @@ where }; // Render result - if stdout_setting.render_output - && !result.is_empty() { - print!("{}", result); - if let Err(e) = tokio::io::stdout().flush().await - && stdout_setting.error_output - { - eprintln!("{}", e); - } + if stdout_setting.render_output && !result.is_empty() { + print!("{}", result); + if let Err(e) = tokio::io::stdout().flush().await + && stdout_setting.error_output + { + eprintln!("{}", e); } + } } } diff --git a/mingling/src/program/config.rs b/mingling/src/program/config.rs index 5877abc..386b112 100644 --- a/mingling/src/program/config.rs +++ b/mingling/src/program/config.rs @@ -16,8 +16,7 @@ impl Default for ProgramStdoutSetting { } } -#[derive(Debug, Clone)] -#[derive(Default)] +#[derive(Debug, Clone, Default)] pub struct ProgramUserContext { /// View help information instead of running the command pub help: bool, @@ -25,4 +24,3 @@ pub struct ProgramUserContext { /// Skip user confirmation step pub confirm: bool, } - diff --git a/mingling/src/program/exec/error.rs b/mingling/src/program/exec/error.rs index 8ce16ff..fe66e22 100644 --- a/mingling/src/program/exec/error.rs +++ b/mingling/src/program/exec/error.rs @@ -38,7 +38,9 @@ impl From<ChainProcessError> for ProgramInternalExecuteError { match value { ChainProcessError::Other(s) => ProgramInternalExecuteError::Other(s), ChainProcessError::IO(error) => ProgramInternalExecuteError::IO(error), - ChainProcessError::Broken(_) => ProgramInternalExecuteError::Other("Broken".to_string()), + ChainProcessError::Broken(_) => { + ProgramInternalExecuteError::Other("Broken".to_string()) + } } } } |
