From 33f8b60e464c55e9491c3b46ff8dca5a9ae81bbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Tue, 24 Aug 2021 20:14:01 +1200 Subject: [PATCH] Take IntoIterator> to be more flexible on input --- lib/src/config.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/src/config.rs b/lib/src/config.rs index 149fc7b..0320446 100644 --- a/lib/src/config.rs +++ b/lib/src/config.rs @@ -66,8 +66,12 @@ impl RuntimeConfig { } /// Set the command to run on action. - pub fn command<'cmd>(&mut self, command: impl IntoIterator) -> &mut Self { - self.action.command = command.into_iter().map(|c| c.to_owned()).collect(); + pub fn command(&mut self, command: I) -> &mut Self + where + I: IntoIterator, + S: AsRef, + { + self.action.command = command.into_iter().map(|c| c.as_ref().to_owned()).collect(); self }