diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lib.rs | 8 | ||||
-rw-r--r-- | src/vtcol.rs | 6 |
2 files changed, 9 insertions, 5 deletions
@@ -1,3 +1,5 @@ +#![allow(clippy::new_without_default)] + use std::{convert::TryFrom, fmt, io::{self, BufWriter, Error, Write}, @@ -72,7 +74,7 @@ pub mod ioctl ioctl( fd.as_raw_fd(), PIO_CMAP, - std::mem::transmute::<&Palette, *const libc::c_void>(&pal), + std::mem::transmute::<&Palette, *const libc::c_void>(pal), ) } }) @@ -1018,7 +1020,7 @@ impl Palette } let mut res = Self::new(); - res.0.copy_from_slice(&b); + res.0.copy_from_slice(b); Ok(res) } @@ -1164,7 +1166,7 @@ impl Console Err(io::Error::new( io::ErrorKind::Other, - format!("could not retrieve fd for any of the search paths"), + String::from("could not retrieve fd for any of the search paths"), )) } diff --git a/src/vtcol.rs b/src/vtcol.rs index 183da18..93cece2 100644 --- a/src/vtcol.rs +++ b/src/vtcol.rs @@ -1,3 +1,5 @@ +#![allow(clippy::option_map_unit_fn)] + pub mod lib; use vtcol::{Console, Fade, KbLedFlags, KbLedState, Palette, Scheme}; @@ -23,7 +25,7 @@ none is explicitly supplied. */ #[inline] fn open_console(path: Option<&str>) -> io::Result<Console> { - path.map(Console::from_path).unwrap_or_else(|| Console::current()) + path.map(Console::from_path).unwrap_or_else(Console::current) } /** Trait for subcommands to implement. */ @@ -767,7 +769,7 @@ impl<'a> Job Ok(Self(con, Subcmd::Colors(ColorJob::List))), ("set", Some(subm)) => { if let Some(b64) = subm.value_of("base64") { - let scheme = Scheme::from_base64(&b64)?; + let scheme = Scheme::from_base64(b64)?; return Ok(Self( con, Subcmd::Colors(ColorJob::Set(scheme)), |