summaryrefslogtreecommitdiffstats
path: root/src/builtins.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2021-12-21 22:58:44 -0500
committerJesse Luehrs <doy@tozt.net>2021-12-21 22:58:44 -0500
commitfea9c70861326fdc1c670e965b1c214741f27be7 (patch)
tree359fb8b4eb29be72ba60c1c27714d8769435a534 /src/builtins.rs
parent3fb13ac480f13c286dc23b340271a1a8706cdf75 (diff)
downloadnbsh-fea9c70861326fdc1c670e965b1c214741f27be7.tar.gz
nbsh-fea9c70861326fdc1c670e965b1c214741f27be7.zip
refactor a bit to start working on better parsing
Diffstat (limited to 'src/builtins.rs')
-rw-r--r--src/builtins.rs4
1 files changed, 2 insertions, 2 deletions
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<Item = &'a str>) -> u8 {
match exe {
"cd" => impls::cd(
- args.iter()
+ args.into_iter()
.map(std::convert::AsRef::as_ref)
.next()
.unwrap_or(""),