summaryrefslogtreecommitdiffstats
path: root/src/unix.rs
diff options
context:
space:
mode:
authorCaleb Bassi <calebjbassi@gmail.com>2019-02-15 19:13:42 -0800
committerCaleb Bassi <calebjbassi@gmail.com>2019-02-15 19:37:29 -0800
commit8b04fec104cd20b86ff98f4da225bb866a407f8c (patch)
treef9b58da3f2a107d136a66c61d08dead883965864 /src/unix.rs
parent055ac602929af367da2af77999e73de6bf8fd344 (diff)
Fix most clippy lints
Diffstat (limited to 'src/unix.rs')
-rw-r--r--src/unix.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/unix.rs b/src/unix.rs
index b7d228f..8a19216 100644
--- a/src/unix.rs
+++ b/src/unix.rs
@@ -35,7 +35,7 @@ pub fn is_executable(mode: u32) -> bool {
return true;
}
}
- return false;
+ false
}
pub fn stringify_mode(mode: libc::mode_t) -> String {
@@ -92,7 +92,7 @@ pub fn set_mode(path: &Path, mode: libc::mode_t) {
}
}
-pub fn open_with_entry(paths: &Vec<PathBuf>, entry: &mimetype::JoshutoMimetypeEntry) {
+pub fn open_with_entry(paths: &[PathBuf], entry: &mimetype::JoshutoMimetypeEntry) {
let program = entry.program.clone();
let mut command = process::Command::new(program);
@@ -123,13 +123,12 @@ pub fn open_with_entry(paths: &Vec<PathBuf>, entry: &mimetype::JoshutoMimetypeEn
}
}
-pub fn open_with_args(paths: &Vec<PathBuf>, args: &Vec<String>) {
+pub fn open_with_args(paths: &[PathBuf], args: &[String]) {
let program = args[0].clone();
- let args_len = args.len();
let mut command = process::Command::new(program);
- for i in 1..args_len {
- command.arg(args[i].clone());
+ for arg in args {
+ command.arg(arg.clone());
}
for path in paths {
command.arg(path.as_os_str());