diff options
author | Justin Wernick <justin@worthe-it.co.za> | 2023-04-11 20:45:11 +0200 |
---|---|---|
committer | Justin Wernick <justin@worthe-it.co.za> | 2023-04-11 20:45:11 +0200 |
commit | e6ed91d0efab436c8a1ca4b6f701b6a9a4d96ccd (patch) | |
tree | d246e448c6cbd86df795452c220f39723d09a714 /src/lib.rs | |
parent | 972319c1811e1a9c4f491a03ba92ea5a624cca5e (diff) |
Refactoring, move where whitespace is handled
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -7,12 +7,11 @@ use rustyline::error::ReadlineError; use std::{io, ops::ControlFlow}; use thiserror::Error; -pub fn run_command(user_input: String) -> Result<ControlFlow<(), ()>, ShackleError> { +pub fn run_command(user_input: &str) -> Result<ControlFlow<(), ()>, ShackleError> { match user_input.parse::<ShackleCommand>() { Err(parse_error) => { println!("{}", parse_error); } - Ok(ShackleCommand::Whitespace) => {} Ok(ShackleCommand::Exit) => { return Ok(ControlFlow::Break(())); } |