Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ fn restart() -> ! {

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

Expand Down
5 changes: 1 addition & 4 deletions src/subprocess.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ pub fn spawn_process(cmd: &str, args: &[&str]) -> io::Result<()> {
// Safety: libc::daemon() is async-signal-safe
unsafe {
proc.pre_exec(|| match libc::daemon(0, 0) {
-1 => Err(io::Error::new(
io::ErrorKind::Other,
"Failed to detach new process",
)),
-1 => Err(io::Error::other("Failed to detach new process")),
_ => Ok(()),
});
}
Expand Down
4 changes: 1 addition & 3 deletions src/themes/xresources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ use std::{env, path::PathBuf};

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