mirror of
https://github.com/watchexec/watchexec.git
synced 2024-11-13 07:41:11 +01:00
Take IntoIterator<AsRef<str>> to be more flexible on input
This commit is contained in:
parent
05afb141b6
commit
33f8b60e46
1 changed files with 6 additions and 2 deletions
|
@ -66,8 +66,12 @@ impl RuntimeConfig {
|
|||
}
|
||||
|
||||
/// Set the command to run on action.
|
||||
pub fn command<'cmd>(&mut self, command: impl IntoIterator<Item = &'cmd str>) -> &mut Self {
|
||||
self.action.command = command.into_iter().map(|c| c.to_owned()).collect();
|
||||
pub fn command<I, S>(&mut self, command: I) -> &mut Self
|
||||
where
|
||||
I: IntoIterator<Item = S>,
|
||||
S: AsRef<str>,
|
||||
{
|
||||
self.action.command = command.into_iter().map(|c| c.as_ref().to_owned()).collect();
|
||||
self
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue