From ea79ae00629ffd3ee8991727bb7122bb7e6c8381 Mon Sep 17 00:00:00 2001 From: Kamiyaa Date: Tue, 26 May 2020 17:01:56 -0400 Subject: open files now pass relative paths instead of full paths --- src/config/mimetype.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/config') 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(&self, paths: I) -> std::io::Result<()> + where + I: IntoIterator, + S: AsRef, { 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() { -- cgit v1.2.3