diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-03-29 17:10:53 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-03-29 17:10:53 +0800 |
| commit | aa9b84a35816e7a119707a4be7a2f19a0160ee44 (patch) | |
| tree | be3ab8f7bbe6d26fb6fe5dc75a7e2c98682b8ed3 /mingling | |
| parent | 637c5507a18390fbe6087805f5204328cdc94bcf (diff) | |
Fix indentation and formatting in program modules
Diffstat (limited to 'mingling')
| -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()) + } } } } |
