From 2f062017c69608d23b7648a66877759e0a291a31 Mon Sep 17 00:00:00 2001 From: fdai7381 Date: Thu, 19 Jan 2023 01:19:53 +0100 Subject: [PATCH] refactoring: remove unnecessary internal keyword parameter --- src/builtins/cd.rs | 2 +- src/builtins/mod.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/builtins/cd.rs b/src/builtins/cd.rs index 263b823..63777d5 100644 --- a/src/builtins/cd.rs +++ b/src/builtins/cd.rs @@ -2,7 +2,7 @@ use std::env::set_current_dir; use crate::error::ShellError; -pub fn run(keyword: &str, args: &[&str]) -> Result<(), ShellError> { +pub fn run(args: &[&str]) -> Result<(), ShellError> { set_current_dir(args[0]); Ok(()) } diff --git a/src/builtins/mod.rs b/src/builtins/mod.rs index dfe335e..f324863 100644 --- a/src/builtins/mod.rs +++ b/src/builtins/mod.rs @@ -9,7 +9,7 @@ pub fn is_builtin(keyword: &str) -> bool { pub fn execute_builtin(keyword: &str, args: &[&str]) -> Result<(), ShellError> { match keyword { - "cd" => cd::run(keyword, args)?, + "cd" => cd::run(args)?, _ => {} } Ok(())