diff options
author | Kamiyaa <jeff.no.zhao@gmail.com> | 2020-05-26 17:01:56 -0400 |
---|---|---|
committer | Kamiyaa <jeff.no.zhao@gmail.com> | 2020-05-26 17:01:56 -0400 |
commit | ea79ae00629ffd3ee8991727bb7122bb7e6c8381 (patch) | |
tree | e2ecac79a39d2ad0e64a1cdef44d0524a6532aa0 /src/config | |
parent | 0a18ffbf9242f47a7c3a0bb56a9f84804ee7dcf5 (diff) |
open files now pass relative paths instead of full paths
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() { |