From e6ed91d0efab436c8a1ca4b6f701b6a9a4d96ccd Mon Sep 17 00:00:00 2001 From: Justin Wernick Date: Tue, 11 Apr 2023 20:45:11 +0200 Subject: Refactoring, move where whitespace is handled --- src/lib.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 134ba97..5fbea79 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -7,12 +7,11 @@ use rustyline::error::ReadlineError; use std::{io, ops::ControlFlow}; use thiserror::Error; -pub fn run_command(user_input: String) -> Result, ShackleError> { +pub fn run_command(user_input: &str) -> Result, ShackleError> { match user_input.parse::() { Err(parse_error) => { println!("{}", parse_error); } - Ok(ShackleCommand::Whitespace) => {} Ok(ShackleCommand::Exit) => { return Ok(ControlFlow::Break(())); } -- cgit v1.2.3