aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMelody Horn <melody@boringcactus.com>2021-03-27 17:17:23 -0600
committerMelody Horn <melody@boringcactus.com>2021-03-27 17:17:23 -0600
commit2a95c7b9d52e09aa82e54350fec514ceb69aab56 (patch)
tree0c503de418de51213f0df96d13b29fcf7c78d76a
parent6fc5a5f9eda8496ca601a8db2db32b4c8e29f2ff (diff)
downloadmakers-2a95c7b9d52e09aa82e54350fec514ceb69aab56.tar.gz
makers-2a95c7b9d52e09aa82e54350fec514ceb69aab56.zip
appease clippy in command_line
-rw-r--r--src/main.rs2
-rw-r--r--src/makefile/command_line.rs6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs
index 0720ada..1c2faf5 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -8,7 +8,7 @@
clippy::cargo,
clippy::nursery
)]
-#![allow(clippy::redundant_pub_crate)]
+#![allow(clippy::redundant_pub_crate, clippy::non_ascii_literal)]
use std::fs::metadata;
use std::io::stdin;
diff --git a/src/makefile/command_line.rs b/src/makefile/command_line.rs
index 6b42105..20b0d25 100644
--- a/src/makefile/command_line.rs
+++ b/src/makefile/command_line.rs
@@ -10,11 +10,11 @@ use crate::makefile::Makefile;
// inspired by python's subprocess module
fn execute_command_line(command_line: &str, ignore_errors: bool) -> Result<ExitStatus, io::Error> {
let (program, args) = if cfg!(windows) {
- let cmd = env::var("COMSPEC").unwrap_or("cmd.exe".into());
+ let cmd = env::var("COMSPEC").unwrap_or_else(|_| "cmd.exe".into());
let args = vec!["/c", command_line];
(cmd, args)
} else {
- let sh = env::var("SHELL").unwrap_or("/bin/sh".into());
+ let sh = env::var("SHELL").unwrap_or_else(|_| "/bin/sh".into());
let args = if ignore_errors {
vec!["-c", command_line]
} else {
@@ -61,7 +61,7 @@ impl CommandLine {
*text = text_chars.collect();
}
- CommandLine {
+ Self {
ignore_errors,
silent,
always_execute,