diff --git a/src/cli/screenshot.rs b/src/cli/screenshot.rs index b94b0da7..e8dfea8d 100644 --- a/src/cli/screenshot.rs +++ b/src/cli/screenshot.rs @@ -63,7 +63,7 @@ async fn run(screenshot: Rc) { .as_deref() .unwrap_or("%Y-%m-%d-%H%M%S_jay.qoi"); let filename = Local::now().format(filename).to_string(); - if let Err(e) = std::fs::write(&filename, &data) { + if let Err(e) = std::fs::write(&filename, data) { fatal!("Could not write `{}`: {}", filename, ErrorFmt(e)); } } diff --git a/src/dbus.rs b/src/dbus.rs index 9a40ff07..f1f88f6e 100644 --- a/src/dbus.rs +++ b/src/dbus.rs @@ -858,7 +858,7 @@ impl MethodHandlerApi for PropertyGetAllHandlerProxy { pub mod prelude { pub use { super::{ - types::{Bool, DictEntry, ObjectPath, Signature, Variant}, + types::{Bool, DictEntry, ObjectPath, Variant}, DbusError, DbusType, Formatter, Message, MethodCall, Parser, Property, Signal, }, std::{borrow::Cow, rc::Rc}, diff --git a/src/forker.rs b/src/forker.rs index 82f505b9..78f64031 100644 --- a/src/forker.rs +++ b/src/forker.rs @@ -319,7 +319,7 @@ impl Forker { level: log::Level::Error as _, msg: format!("The ol' forker panicked: {}", pi), }; - let msg = bincode::encode_to_vec(&msg, bincode_ops()).unwrap(); + let msg = bincode::encode_to_vec(msg, bincode_ops()).unwrap(); let _ = Fd::new(socket).write_all(&msg); }) }); diff --git a/src/video/drm.rs b/src/video/drm.rs index 8c9e8402..24d55df2 100644 --- a/src/video/drm.rs +++ b/src/video/drm.rs @@ -131,7 +131,7 @@ fn reopen(fd: c::c_int, need_primary: bool) -> Result, DrmError> { } device_node_name(fd)? }; - match uapi::open(&path, c::O_RDWR | c::O_CLOEXEC, 0) { + match uapi::open(path, c::O_RDWR | c::O_CLOEXEC, 0) { Ok(f) => Ok(Rc::new(f)), Err(e) => Err(DrmError::ReopenNode(e.into())), } diff --git a/src/video/drm/sys.rs b/src/video/drm/sys.rs index 35c4dd03..3c792857 100644 --- a/src/video/drm/sys.rs +++ b/src/video/drm/sys.rs @@ -77,7 +77,7 @@ pub fn get_node_type_from_fd(fd: c::c_int) -> Result { pub fn node_is_drm(maj: u64, min: u64) -> bool { let path = device_dir(maj, min); - uapi::stat(&path).is_ok() + uapi::stat(path).is_ok() } pub fn get_minor_type(min: u64) -> Result { @@ -102,7 +102,7 @@ pub fn get_minor_name_from_fd(fd: c::c_int, ty: NodeType) -> Result Result { let (_, maj, min) = drm_stat(fd)?; let path = uapi::format_ustr!("/sys/dev/char/{maj}:{min}/uevent"); let mut buf = vec![]; - let mut br = BufReader::new(uapi::open(&path, c::O_RDONLY, 0)?); + let mut br = BufReader::new(uapi::open(path, c::O_RDONLY, 0)?); loop { buf.clear(); if br.read_until(b'\n', &mut buf)? == 0 { @@ -155,7 +155,7 @@ pub fn get_nodes(fd: c::c_int) -> Result, OsError> { let (_, maj, min) = drm_stat(fd)?; let dir = device_dir(maj, min); - let mut dir = uapi::opendir(&dir)?; + let mut dir = uapi::opendir(dir)?; let mut res = AHashMap::new(); diff --git a/src/xcon/xauthority.rs b/src/xcon/xauthority.rs index 32acd840..09827d30 100644 --- a/src/xcon/xauthority.rs +++ b/src/xcon/xauthority.rs @@ -29,7 +29,7 @@ impl XAuthority { return Err(XconError::HomeNotSet); }; let mut buf = vec![]; - if let Err(e) = File::open(&path).and_then(|mut f| f.read_to_end(&mut buf)) { + if let Err(e) = File::open(path).and_then(|mut f| f.read_to_end(&mut buf)) { return Err(XconError::ReadXAuthority(e)); } Parser::parse(&buf)