Skip to content

Commit 4de118a

Browse files
authored
fix clippy lints on nightly (#2158)
1 parent 86e8112 commit 4de118a

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ fn restart() -> ! {
8080

8181
// Add "--no-init" argument if not already added
8282
let no_init_arg = CString::new("--no-init").unwrap();
83-
if !arg.iter().any(|a| *a == no_init_arg) {
83+
if !arg.contains(&no_init_arg) {
8484
arg.push(no_init_arg);
8585
}
8686

src/subprocess.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@ pub fn spawn_process(cmd: &str, args: &[&str]) -> io::Result<()> {
1111
// Safety: libc::daemon() is async-signal-safe
1212
unsafe {
1313
proc.pre_exec(|| match libc::daemon(0, 0) {
14-
-1 => Err(io::Error::new(
15-
io::ErrorKind::Other,
16-
"Failed to detach new process",
17-
)),
14+
-1 => Err(io::Error::other("Failed to detach new process")),
1815
_ => Ok(()),
1916
});
2017
}

src/themes/xresources.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ use std::{env, path::PathBuf};
1111

1212
#[cfg(not(test))]
1313
fn read_xresources() -> std::io::Result<String> {
14-
use std::io::{Error, ErrorKind};
15-
let home =
16-
env::var("HOME").map_err(|_| Error::new(ErrorKind::Other, "HOME env var was not set"))?;
14+
let home = env::var("HOME").map_err(|_| std::io::Error::other("HOME env var was not set"))?;
1715
let xresources = PathBuf::from(home + "/.Xresources");
1816
debug!(".Xresources @ {:?}", xresources);
1917
std::fs::read_to_string(xresources)

0 commit comments

Comments
 (0)