diff options
Diffstat (limited to 'src/config')
-rw-r--r-- | src/config/mimetype.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/config/mimetype.rs b/src/config/mimetype.rs index 0520d9e..189dd29 100644 --- a/src/config/mimetype.rs +++ b/src/config/mimetype.rs @@ -82,7 +82,10 @@ impl JoshutoMimetypeEntry { self._confirm_exit } - pub fn execute_with(&self, paths: &[&Path]) -> std::io::Result<()> { + pub fn execute_with<I, S>(&self, paths: I) -> std::io::Result<()> + where + I: IntoIterator<Item = S>, + S: AsRef<std::ffi::OsStr>, { let program = String::from(self.get_command()); let mut command = process::Command::new(program); @@ -92,7 +95,7 @@ impl JoshutoMimetypeEntry { } command.args(self.get_args()); - command.args(paths.iter().map(|path| path.as_os_str())); + command.args(paths); let mut handle = command.spawn()?; if !self.get_fork() { |