From e3fd9254372452f2dcff6811c9b09ced41d1c372 Mon Sep 17 00:00:00 2001 From: Ryuichi Ueda Date: Sat, 18 Jan 2025 17:19:07 +0900 Subject: [PATCH] Remove warnings --- src/elements/command.rs | 4 ++-- src/elements/command/simple.rs | 2 +- src/feeder/terminal/completion.rs | 2 +- test/ok | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/elements/command.rs b/src/elements/command.rs index 357049fa..94fe070f 100644 --- a/src/elements/command.rs +++ b/src/elements/command.rs @@ -59,7 +59,7 @@ pub trait Command { Ok(ForkResult::Child) => { core.initialize_as_subshell(Pid::from_raw(0), pipe.pgid); io::connect(pipe, self.get_redirects(), core); - self.run(core, true); + let _ = self.run(core, true); exit::normal(core) }, Ok(ForkResult::Parent { child } ) => { @@ -73,7 +73,7 @@ pub trait Command { fn nofork_exec(&mut self, core: &mut ShellCore) -> Result, ExecError> { if self.get_redirects().iter_mut().all(|r| r.connect(true, core)){ - self.run(core, false); + let _ = self.run(core, false); }else{ core.db.exit_status = 1; } diff --git a/src/elements/command/simple.rs b/src/elements/command/simple.rs index 2c63819f..dd5dbc69 100644 --- a/src/elements/command/simple.rs +++ b/src/elements/command/simple.rs @@ -54,7 +54,7 @@ impl Command for SimpleCommand { if core.db.functions.contains_key(&self.args[0]) { let mut f = core.db.functions[&self.args[0]].clone(); - f.run_as_command(&mut self.args, core); + let _ = f.run_as_command(&mut self.args, core); } else if core.builtins.contains_key(&self.args[0]) { let mut special_args = self.substitutions_as_args.iter() .map(|a| a.text.clone()).collect(); diff --git a/src/feeder/terminal/completion.rs b/src/feeder/terminal/completion.rs index 1e458ef3..45cfb98d 100644 --- a/src/feeder/terminal/completion.rs +++ b/src/feeder/terminal/completion.rs @@ -86,7 +86,7 @@ impl Terminal { if let Ok(Some(mut a)) = SimpleCommand::parse(&mut feeder, core) { let mut dummy = Pipe::new("".to_string()); - a.exec(core, &mut dummy); + let _ = a.exec(core, &mut dummy); } match core.db.len("COMPREPLY") { 0 => Err("no completion cand".to_string()), diff --git a/test/ok b/test/ok index d6117d26..dca1e47d 100644 --- a/test/ok +++ b/test/ok @@ -1,7 +1,7 @@ ./test_script.bash ./test_options.bash -./test_glob.bash ./test_redirects.bash +./test_glob.bash ./test_brace.bash ./test_builtins.bash ./test_others.bash