diff options
| author | Fuwn <[email protected]> | 2021-06-05 22:42:55 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2021-06-05 22:42:55 -0700 |
| commit | 954fef63bf57d9eb18f2bf0e3e5a123a92a2482e (patch) | |
| tree | c2d3c035c22ff6604eb504d10333b6389cd4f909 /crates/whirl_prompt | |
| parent | feat(make): document generation task (diff) | |
| download | whirl-954fef63bf57d9eb18f2bf0e3e5a123a92a2482e.tar.xz whirl-954fef63bf57d9eb18f2bf0e3e5a123a92a2482e.zip | |
build(global): bump toolchain release
This commit also fixes all of the new lints that arose because of the bump.
Diffstat (limited to 'crates/whirl_prompt')
| -rw-r--r-- | crates/whirl_prompt/src/builtins/mod.rs | 2 | ||||
| -rw-r--r-- | crates/whirl_prompt/src/lib.rs | 8 |
2 files changed, 4 insertions, 6 deletions
diff --git a/crates/whirl_prompt/src/builtins/mod.rs b/crates/whirl_prompt/src/builtins/mod.rs index 2bebd31..655f507 100644 --- a/crates/whirl_prompt/src/builtins/mod.rs +++ b/crates/whirl_prompt/src/builtins/mod.rs @@ -39,7 +39,7 @@ pub fn builtin_ls() -> i32 { 0 } -pub async fn builtin_cat(args: &[String]) -> i32 { +pub fn builtin_cat(args: &[String]) -> i32 { let file; if let Some(file_name) = args.get(0) { file = file_name.to_string(); diff --git a/crates/whirl_prompt/src/lib.rs b/crates/whirl_prompt/src/lib.rs index a7b2389..4b82b83 100644 --- a/crates/whirl_prompt/src/lib.rs +++ b/crates/whirl_prompt/src/lib.rs @@ -55,9 +55,7 @@ impl Prompt { loop { Self::write_prompt(); let command = Self::read_command(); - prompt - .process_command(Self::tokenize_command(&command)) - .await; + prompt.process_command(&Self::tokenize_command(&command)); } } @@ -93,7 +91,7 @@ impl Prompt { // TODO: Find a way to make this access itself `history` doesn't have to be // passed everytime. - async fn process_command(&mut self, c: Command) -> i32 { + fn process_command(&mut self, c: &Command) -> i32 { let exit_code = match BuiltIn::from_str(&c.keyword) { Ok(BuiltIn::Echo) => builtin_echo(&c.args), Ok(BuiltIn::Exit) => std::process::exit(0), @@ -101,7 +99,7 @@ impl Prompt { Ok(BuiltIn::Null) => 0, Ok(BuiltIn::Help) => builtin_help(), Ok(BuiltIn::Ls) => builtin_ls(), - Ok(BuiltIn::Cat) => builtin_cat(&c.args).await, + Ok(BuiltIn::Cat) => builtin_cat(&c.args), Ok(BuiltIn::Config) => builtin_config(&c.args), Ok(BuiltIn::Fetch) => builtin_fetch(), _ => { |