diff --git a/src/execute.rs b/src/execute.rs index d48f58d..92f000f 100644 --- a/src/execute.rs +++ b/src/execute.rs @@ -5,11 +5,11 @@ use crate::builtins::{execute_builtin, is_builtin}; use crate::error::ShellError; use crate::parse::parse_line; -pub fn interpret(line: &str) -> Result<(), ShellError> { +pub fn interpret(line: String) -> Result<(), ShellError> { if line.is_empty() { return Err(ShellError::EmptyLine); } - let (keyword, args) = parse_line(line)?; + let (keyword, args) = parse_line(&line)?; if is_builtin(keyword) { execute_builtin(keyword, args)?; diff --git a/src/main.rs b/src/main.rs index 61298e6..76c24d1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -20,7 +20,7 @@ fn main() -> Result<()> { let readline = rl.readline(&prompt.get_prompt()); match readline { - Ok(line) => match interpret(&line) { + Ok(line) => match interpret(line) { Ok(_) => {} Err(ShellError::EmptyLine) => { continue;