From fea9c70861326fdc1c670e965b1c214741f27be7 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 21 Dec 2021 22:58:44 -0500 Subject: refactor a bit to start working on better parsing --- src/builtins.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/builtins.rs') diff --git a/src/builtins.rs b/src/builtins.rs index 8494c7e..e8f87da 100644 --- a/src/builtins.rs +++ b/src/builtins.rs @@ -2,10 +2,10 @@ pub fn is(exe: &str) -> bool { matches!(exe, "cd") } -pub fn run(exe: &str, args: &[String]) -> u8 { +pub fn run<'a>(exe: &str, args: impl IntoIterator) -> u8 { match exe { "cd" => impls::cd( - args.iter() + args.into_iter() .map(std::convert::AsRef::as_ref) .next() .unwrap_or(""), -- cgit v1.2.3-54-g00ecf