From cca73cec7de2e6339990b56b6e572ae137ce3668 Mon Sep 17 00:00:00 2001 From: Igor Date: Sun, 13 Oct 2024 11:17:58 +0400 Subject: [PATCH] style: fix cargo fmt --- brush-core/src/builtins/alias.rs | 1 - brush-core/src/builtins/bg.rs | 1 - brush-core/src/builtins/break_.rs | 1 - brush-core/src/builtins/brushinfo.rs | 1 - brush-core/src/builtins/builtin_.rs | 1 - brush-core/src/builtins/cd.rs | 1 - brush-core/src/builtins/colon.rs | 1 - brush-core/src/builtins/command.rs | 1 - brush-core/src/builtins/complete.rs | 3 --- brush-core/src/builtins/continue_.rs | 1 - brush-core/src/builtins/declare.rs | 1 - brush-core/src/builtins/dirs.rs | 1 - brush-core/src/builtins/dot.rs | 1 - brush-core/src/builtins/echo.rs | 5 ++--- brush-core/src/builtins/enable.rs | 1 - brush-core/src/builtins/eval.rs | 1 - brush-core/src/builtins/exec.rs | 1 - brush-core/src/builtins/exit.rs | 1 - brush-core/src/builtins/export.rs | 1 - brush-core/src/builtins/false_.rs | 1 - brush-core/src/builtins/fg.rs | 1 - brush-core/src/builtins/getopts.rs | 1 - brush-core/src/builtins/help.rs | 1 - brush-core/src/builtins/jobs.rs | 1 - brush-core/src/builtins/kill.rs | 2 -- brush-core/src/builtins/let_.rs | 1 - brush-core/src/builtins/popd.rs | 2 -- brush-core/src/builtins/printf.rs | 1 - brush-core/src/builtins/pushd.rs | 2 -- brush-core/src/builtins/pwd.rs | 1 - brush-core/src/builtins/read.rs | 1 - brush-core/src/builtins/return_.rs | 1 - brush-core/src/builtins/set.rs | 1 - brush-core/src/builtins/shift.rs | 1 - brush-core/src/builtins/shopt.rs | 1 - brush-core/src/builtins/test.rs | 1 - brush-core/src/builtins/trap.rs | 1 - brush-core/src/builtins/true_.rs | 1 - brush-core/src/builtins/type_.rs | 1 - brush-core/src/builtins/umask.rs | 1 - brush-core/src/builtins/unalias.rs | 1 - brush-core/src/builtins/unimp.rs | 1 - brush-core/src/builtins/unset.rs | 1 - brush-core/src/builtins/wait.rs | 1 - brush-interactive/src/interactive_shell.rs | 3 ++- 45 files changed, 4 insertions(+), 52 deletions(-) diff --git a/brush-core/src/builtins/alias.rs b/brush-core/src/builtins/alias.rs index 99177ff..7b9f7c2 100644 --- a/brush-core/src/builtins/alias.rs +++ b/brush-core/src/builtins/alias.rs @@ -15,7 +15,6 @@ pub(crate) struct AliasCommand { aliases: Vec, } - impl builtins::Command for AliasCommand { async fn execute( &self, diff --git a/brush-core/src/builtins/bg.rs b/brush-core/src/builtins/bg.rs index 98d7d7b..7faca92 100644 --- a/brush-core/src/builtins/bg.rs +++ b/brush-core/src/builtins/bg.rs @@ -10,7 +10,6 @@ pub(crate) struct BgCommand { job_specs: Vec, } - impl builtins::Command for BgCommand { async fn execute( &self, diff --git a/brush-core/src/builtins/break_.rs b/brush-core/src/builtins/break_.rs index 83cdbf1..246c15b 100644 --- a/brush-core/src/builtins/break_.rs +++ b/brush-core/src/builtins/break_.rs @@ -10,7 +10,6 @@ pub(crate) struct BreakCommand { which_loop: i8, } - impl builtins::Command for BreakCommand { async fn execute( &self, diff --git a/brush-core/src/builtins/brushinfo.rs b/brush-core/src/builtins/brushinfo.rs index d7d8a9d..9db907c 100644 --- a/brush-core/src/builtins/brushinfo.rs +++ b/brush-core/src/builtins/brushinfo.rs @@ -53,7 +53,6 @@ enum CompleteCommand { }, } - impl builtins::Command for BrushInfoCommand { async fn execute( &self, diff --git a/brush-core/src/builtins/builtin_.rs b/brush-core/src/builtins/builtin_.rs index be52262..a6fbd42 100644 --- a/brush-core/src/builtins/builtin_.rs +++ b/brush-core/src/builtins/builtin_.rs @@ -14,7 +14,6 @@ pub(crate) struct BuiltinCommand { args: Vec, } - impl builtins::Command for BuiltinCommand { async fn execute( &self, diff --git a/brush-core/src/builtins/cd.rs b/brush-core/src/builtins/cd.rs index b505f5c..63a67d9 100644 --- a/brush-core/src/builtins/cd.rs +++ b/brush-core/src/builtins/cd.rs @@ -28,7 +28,6 @@ pub(crate) struct CdCommand { target_dir: Option, } - impl builtins::Command for CdCommand { async fn execute( &self, diff --git a/brush-core/src/builtins/colon.rs b/brush-core/src/builtins/colon.rs index 85662e4..371d1ed 100644 --- a/brush-core/src/builtins/colon.rs +++ b/brush-core/src/builtins/colon.rs @@ -10,7 +10,6 @@ pub(crate) struct ColonCommand { args: Vec, } - impl builtins::Command for ColonCommand { async fn execute( &self, diff --git a/brush-core/src/builtins/command.rs b/brush-core/src/builtins/command.rs index 990445e..eb6ed8b 100644 --- a/brush-core/src/builtins/command.rs +++ b/brush-core/src/builtins/command.rs @@ -26,7 +26,6 @@ pub(crate) struct CommandCommand { args: Vec, } - impl builtins::Command for CommandCommand { async fn execute( &self, diff --git a/brush-core/src/builtins/complete.rs b/brush-core/src/builtins/complete.rs index 1fca5b4..dcbf23c 100644 --- a/brush-core/src/builtins/complete.rs +++ b/brush-core/src/builtins/complete.rs @@ -210,7 +210,6 @@ pub(crate) struct CompleteCommand { names: Vec, } - impl builtins::Command for CompleteCommand { async fn execute( &self, @@ -435,7 +434,6 @@ pub(crate) struct CompGenCommand { word: Option, } - impl builtins::Command for CompGenCommand { async fn execute( &self, @@ -514,7 +512,6 @@ pub(crate) struct CompOptCommand { names: Vec, } - impl builtins::Command for CompOptCommand { async fn execute( &self, diff --git a/brush-core/src/builtins/continue_.rs b/brush-core/src/builtins/continue_.rs index 673d0c3..7963118 100644 --- a/brush-core/src/builtins/continue_.rs +++ b/brush-core/src/builtins/continue_.rs @@ -10,7 +10,6 @@ pub(crate) struct ContinueCommand { which_loop: i8, } - impl builtins::Command for ContinueCommand { async fn execute( &self, diff --git a/brush-core/src/builtins/declare.rs b/brush-core/src/builtins/declare.rs index 82e1337..1515338 100644 --- a/brush-core/src/builtins/declare.rs +++ b/brush-core/src/builtins/declare.rs @@ -110,7 +110,6 @@ impl builtins::DeclarationCommand for DeclareCommand { } #[allow(clippy::too_many_lines)] - impl builtins::Command for DeclareCommand { fn takes_plus_options() -> bool { true diff --git a/brush-core/src/builtins/dirs.rs b/brush-core/src/builtins/dirs.rs index 4e87126..9024f72 100644 --- a/brush-core/src/builtins/dirs.rs +++ b/brush-core/src/builtins/dirs.rs @@ -25,7 +25,6 @@ pub(crate) struct DirsCommand { // TODO: implement +N and -N } - impl builtins::Command for DirsCommand { async fn execute( &self, diff --git a/brush-core/src/builtins/dot.rs b/brush-core/src/builtins/dot.rs index 2069ab3..34b0dac 100644 --- a/brush-core/src/builtins/dot.rs +++ b/brush-core/src/builtins/dot.rs @@ -15,7 +15,6 @@ pub(crate) struct DotCommand { pub script_args: Vec, } - impl builtins::Command for DotCommand { async fn execute( &self, diff --git a/brush-core/src/builtins/echo.rs b/brush-core/src/builtins/echo.rs index a98a2fb..a4df5b7 100644 --- a/brush-core/src/builtins/echo.rs +++ b/brush-core/src/builtins/echo.rs @@ -24,10 +24,9 @@ pub(crate) struct EchoCommand { args: Vec, } - impl builtins::Command for EchoCommand { - /// Override the default [builtins::Command::new] function to handle clap's limitation related to `--`. - /// See [crate::builtins::parse_known] for more information + /// Override the default [builtins::Command::new] function to handle clap's limitation related + /// to `--`. See [crate::builtins::parse_known] for more information /// TODO: we can safely remove this after the issue is resolved fn new(args: I) -> Result where diff --git a/brush-core/src/builtins/enable.rs b/brush-core/src/builtins/enable.rs index ada10a4..6bc0da6 100644 --- a/brush-core/src/builtins/enable.rs +++ b/brush-core/src/builtins/enable.rs @@ -37,7 +37,6 @@ pub(crate) struct EnableCommand { names: Vec, } - impl builtins::Command for EnableCommand { async fn execute( &self, diff --git a/brush-core/src/builtins/eval.rs b/brush-core/src/builtins/eval.rs index fc653da..c970a32 100644 --- a/brush-core/src/builtins/eval.rs +++ b/brush-core/src/builtins/eval.rs @@ -9,7 +9,6 @@ pub(crate) struct EvalCommand { pub args: Vec, } - impl builtins::Command for EvalCommand { async fn execute( &self, diff --git a/brush-core/src/builtins/exec.rs b/brush-core/src/builtins/exec.rs index e9ca0b8..0137e99 100644 --- a/brush-core/src/builtins/exec.rs +++ b/brush-core/src/builtins/exec.rs @@ -23,7 +23,6 @@ pub(crate) struct ExecCommand { args: Vec, } - impl builtins::Command for ExecCommand { async fn execute( &self, diff --git a/brush-core/src/builtins/exit.rs b/brush-core/src/builtins/exit.rs index 58b853b..9c5b9d0 100644 --- a/brush-core/src/builtins/exit.rs +++ b/brush-core/src/builtins/exit.rs @@ -9,7 +9,6 @@ pub(crate) struct ExitCommand { code: Option, } - impl builtins::Command for ExitCommand { async fn execute( &self, diff --git a/brush-core/src/builtins/export.rs b/brush-core/src/builtins/export.rs index 2211a61..19541f4 100644 --- a/brush-core/src/builtins/export.rs +++ b/brush-core/src/builtins/export.rs @@ -37,7 +37,6 @@ impl builtins::DeclarationCommand for ExportCommand { } } - impl builtins::Command for ExportCommand { async fn execute( &self, diff --git a/brush-core/src/builtins/false_.rs b/brush-core/src/builtins/false_.rs index 73bdbde..a2be7aa 100644 --- a/brush-core/src/builtins/false_.rs +++ b/brush-core/src/builtins/false_.rs @@ -6,7 +6,6 @@ use crate::{builtins, commands}; #[derive(Parser)] pub(crate) struct FalseCommand {} - impl builtins::Command for FalseCommand { async fn execute( &self, diff --git a/brush-core/src/builtins/fg.rs b/brush-core/src/builtins/fg.rs index 6fedd30..231d38c 100644 --- a/brush-core/src/builtins/fg.rs +++ b/brush-core/src/builtins/fg.rs @@ -10,7 +10,6 @@ pub(crate) struct FgCommand { job_spec: Option, } - impl builtins::Command for FgCommand { async fn execute( &self, diff --git a/brush-core/src/builtins/getopts.rs b/brush-core/src/builtins/getopts.rs index 9beaca4..3d97160 100644 --- a/brush-core/src/builtins/getopts.rs +++ b/brush-core/src/builtins/getopts.rs @@ -18,7 +18,6 @@ pub(crate) struct GetOptsCommand { args: Vec, } - impl builtins::Command for GetOptsCommand { async fn execute( &self, diff --git a/brush-core/src/builtins/help.rs b/brush-core/src/builtins/help.rs index 93fb2b6..32d0fde 100644 --- a/brush-core/src/builtins/help.rs +++ b/brush-core/src/builtins/help.rs @@ -22,7 +22,6 @@ pub(crate) struct HelpCommand { topic_patterns: Vec, } - impl builtins::Command for HelpCommand { async fn execute( &self, diff --git a/brush-core/src/builtins/jobs.rs b/brush-core/src/builtins/jobs.rs index da25fd9..b0ef597 100644 --- a/brush-core/src/builtins/jobs.rs +++ b/brush-core/src/builtins/jobs.rs @@ -31,7 +31,6 @@ pub(crate) struct JobsCommand { job_specs: Vec, } - impl builtins::Command for JobsCommand { async fn execute( &self, diff --git a/brush-core/src/builtins/kill.rs b/brush-core/src/builtins/kill.rs index d4f0883..6188710 100644 --- a/brush-core/src/builtins/kill.rs +++ b/brush-core/src/builtins/kill.rs @@ -16,7 +16,6 @@ pub(crate) struct KillCommand { // // TODO: implement -sigspec syntax - // /// List known signal names. #[arg(short = 'l', short_alias = 'L')] list_signals: bool, @@ -25,7 +24,6 @@ pub(crate) struct KillCommand { args: Vec, } - impl builtins::Command for KillCommand { async fn execute( &self, diff --git a/brush-core/src/builtins/let_.rs b/brush-core/src/builtins/let_.rs index 9ac8f68..9f2cb4a 100644 --- a/brush-core/src/builtins/let_.rs +++ b/brush-core/src/builtins/let_.rs @@ -11,7 +11,6 @@ pub(crate) struct LetCommand { exprs: Vec, } - impl builtins::Command for LetCommand { async fn execute( &self, diff --git a/brush-core/src/builtins/popd.rs b/brush-core/src/builtins/popd.rs index fc7daf5..d525feb 100644 --- a/brush-core/src/builtins/popd.rs +++ b/brush-core/src/builtins/popd.rs @@ -11,10 +11,8 @@ pub(crate) struct PopdCommand { no_directory_change: bool, // // TODO: implement +N and -N - // } - impl builtins::Command for PopdCommand { async fn execute( &self, diff --git a/brush-core/src/builtins/printf.rs b/brush-core/src/builtins/printf.rs index 5cad9a9..a539099 100644 --- a/brush-core/src/builtins/printf.rs +++ b/brush-core/src/builtins/printf.rs @@ -16,7 +16,6 @@ pub(crate) struct PrintfCommand { format_and_args: Vec, } - impl builtins::Command for PrintfCommand { async fn execute( &self, diff --git a/brush-core/src/builtins/pushd.rs b/brush-core/src/builtins/pushd.rs index 69beeb9..595dedd 100644 --- a/brush-core/src/builtins/pushd.rs +++ b/brush-core/src/builtins/pushd.rs @@ -13,10 +13,8 @@ pub(crate) struct PushdCommand { dir: String, // // TODO: implement +N and -N - // } - impl builtins::Command for PushdCommand { async fn execute( &self, diff --git a/brush-core/src/builtins/pwd.rs b/brush-core/src/builtins/pwd.rs index c3ad8f9..8ad06db 100644 --- a/brush-core/src/builtins/pwd.rs +++ b/brush-core/src/builtins/pwd.rs @@ -14,7 +14,6 @@ pub(crate) struct PwdCommand { allow_symlinks: bool, } - impl builtins::Command for PwdCommand { async fn execute( &self, diff --git a/brush-core/src/builtins/read.rs b/brush-core/src/builtins/read.rs index 05484db..ab70f84 100644 --- a/brush-core/src/builtins/read.rs +++ b/brush-core/src/builtins/read.rs @@ -59,7 +59,6 @@ pub(crate) struct ReadCommand { variable_names: Vec, } - impl builtins::Command for ReadCommand { async fn execute( &self, diff --git a/brush-core/src/builtins/return_.rs b/brush-core/src/builtins/return_.rs index 7483e5d..f52e3d4 100644 --- a/brush-core/src/builtins/return_.rs +++ b/brush-core/src/builtins/return_.rs @@ -9,7 +9,6 @@ pub(crate) struct ReturnCommand { code: Option, } - impl builtins::Command for ReturnCommand { async fn execute( &self, diff --git a/brush-core/src/builtins/set.rs b/brush-core/src/builtins/set.rs index ce7b16e..9fa6448 100644 --- a/brush-core/src/builtins/set.rs +++ b/brush-core/src/builtins/set.rs @@ -130,7 +130,6 @@ pub(crate) struct SetCommand { positional_args: Vec, } - impl builtins::Command for SetCommand { fn takes_plus_options() -> bool { true diff --git a/brush-core/src/builtins/shift.rs b/brush-core/src/builtins/shift.rs index f641ba0..df38628 100644 --- a/brush-core/src/builtins/shift.rs +++ b/brush-core/src/builtins/shift.rs @@ -9,7 +9,6 @@ pub(crate) struct ShiftCommand { n: Option, } - impl builtins::Command for ShiftCommand { async fn execute( &self, diff --git a/brush-core/src/builtins/shopt.rs b/brush-core/src/builtins/shopt.rs index cd78faa..d1604b2 100644 --- a/brush-core/src/builtins/shopt.rs +++ b/brush-core/src/builtins/shopt.rs @@ -31,7 +31,6 @@ pub(crate) struct ShoptCommand { options: Vec, } - impl builtins::Command for ShoptCommand { async fn execute( &self, diff --git a/brush-core/src/builtins/test.rs b/brush-core/src/builtins/test.rs index 1f238a4..532552c 100644 --- a/brush-core/src/builtins/test.rs +++ b/brush-core/src/builtins/test.rs @@ -11,7 +11,6 @@ pub(crate) struct TestCommand { args: Vec, } - impl builtins::Command for TestCommand { async fn execute( &self, diff --git a/brush-core/src/builtins/trap.rs b/brush-core/src/builtins/trap.rs index 768c35b..1a9cc71 100644 --- a/brush-core/src/builtins/trap.rs +++ b/brush-core/src/builtins/trap.rs @@ -17,7 +17,6 @@ pub(crate) struct TrapCommand { args: Vec, } - impl builtins::Command for TrapCommand { async fn execute( &self, diff --git a/brush-core/src/builtins/true_.rs b/brush-core/src/builtins/true_.rs index fb4be60..c70c34c 100644 --- a/brush-core/src/builtins/true_.rs +++ b/brush-core/src/builtins/true_.rs @@ -6,7 +6,6 @@ use crate::{builtins, commands}; #[derive(Parser)] pub(crate) struct TrueCommand {} - impl builtins::Command for TrueCommand { async fn execute( &self, diff --git a/brush-core/src/builtins/type_.rs b/brush-core/src/builtins/type_.rs index 7d30b85..8723981 100644 --- a/brush-core/src/builtins/type_.rs +++ b/brush-core/src/builtins/type_.rs @@ -44,7 +44,6 @@ enum ResolvedType { File(PathBuf), } - impl builtins::Command for TypeCommand { async fn execute( &self, diff --git a/brush-core/src/builtins/umask.rs b/brush-core/src/builtins/umask.rs index 83cee0d..8a2ce74 100644 --- a/brush-core/src/builtins/umask.rs +++ b/brush-core/src/builtins/umask.rs @@ -20,7 +20,6 @@ pub(crate) struct UmaskCommand { mode: Option, } - impl builtins::Command for UmaskCommand { async fn execute( &self, diff --git a/brush-core/src/builtins/unalias.rs b/brush-core/src/builtins/unalias.rs index 16aeb7f..50992a9 100644 --- a/brush-core/src/builtins/unalias.rs +++ b/brush-core/src/builtins/unalias.rs @@ -14,7 +14,6 @@ pub(crate) struct UnaliasCommand { aliases: Vec, } - impl builtins::Command for UnaliasCommand { async fn execute( &self, diff --git a/brush-core/src/builtins/unimp.rs b/brush-core/src/builtins/unimp.rs index 3ffb222..db60c69 100644 --- a/brush-core/src/builtins/unimp.rs +++ b/brush-core/src/builtins/unimp.rs @@ -13,7 +13,6 @@ pub(crate) struct UnimplementedCommand { declarations: Vec, } - impl builtins::Command for UnimplementedCommand { async fn execute( &self, diff --git a/brush-core/src/builtins/unset.rs b/brush-core/src/builtins/unset.rs index cc0fcd8..94ac005 100644 --- a/brush-core/src/builtins/unset.rs +++ b/brush-core/src/builtins/unset.rs @@ -34,7 +34,6 @@ impl UnsetNameInterpretation { } } - impl builtins::Command for UnsetCommand { async fn execute( &self, diff --git a/brush-core/src/builtins/wait.rs b/brush-core/src/builtins/wait.rs index fa254a4..c8dbf0b 100644 --- a/brush-core/src/builtins/wait.rs +++ b/brush-core/src/builtins/wait.rs @@ -22,7 +22,6 @@ pub(crate) struct WaitCommand { job_specs: Vec, } - impl builtins::Command for WaitCommand { async fn execute( &self, diff --git a/brush-interactive/src/interactive_shell.rs b/brush-interactive/src/interactive_shell.rs index 84b0c7d..914c09a 100644 --- a/brush-interactive/src/interactive_shell.rs +++ b/brush-interactive/src/interactive_shell.rs @@ -53,7 +53,8 @@ pub trait InteractiveShell { /// Runs the interactive shell loop, reading commands from standard input and writing /// results to standard output and standard error. Continues until the shell /// normally exits or until a fatal error occurs. - // NOTE: we use desugared async here because [async_fn_in_trait] "warning: use of `async fn` in public traits is discouraged as auto trait bounds cannot be specified" + // NOTE: we use desugared async here because [async_fn_in_trait] "warning: use of `async fn` in + // public traits is discouraged as auto trait bounds cannot be specified" fn run_interactively(&mut self) -> impl std::future::Future> { async { // TODO: Consider finding a better place for this.