Take IntoIterator<AsRef<str>> to be more flexible on input
This commit is contained in:
parent
05afb141b6
commit
33f8b60e46
|
@ -66,8 +66,12 @@ impl RuntimeConfig {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Set the command to run on action.
|
/// Set the command to run on action.
|
||||||
pub fn command<'cmd>(&mut self, command: impl IntoIterator<Item = &'cmd str>) -> &mut Self {
|
pub fn command<I, S>(&mut self, command: I) -> &mut Self
|
||||||
self.action.command = command.into_iter().map(|c| c.to_owned()).collect();
|
where
|
||||||
|
I: IntoIterator<Item = S>,
|
||||||
|
S: AsRef<str>,
|
||||||
|
{
|
||||||
|
self.action.command = command.into_iter().map(|c| c.as_ref().to_owned()).collect();
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue