From a09b1c8ac643d448db479a108ac6726307075453 Mon Sep 17 00:00:00 2001 From: Alan Somers Date: Sat, 18 Sep 2021 21:07:00 -0600 Subject: Clippy cleanup And this time, start running Clippy in CI --- src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 7a64b97a..3a2b63ab 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -160,7 +160,7 @@ impl NixPath for CStr { where F: FnOnce(&CStr) -> T { // Equivalence with the [u8] impl. if self.len() >= PATH_MAX as usize { - return Err(Error::from(Errno::ENAMETOOLONG)) + return Err(Errno::ENAMETOOLONG) } Ok(f(self)) @@ -181,11 +181,11 @@ impl NixPath for [u8] { let mut buf = [0u8; PATH_MAX as usize]; if self.len() >= PATH_MAX as usize { - return Err(Error::from(Errno::ENAMETOOLONG)) + return Err(Errno::ENAMETOOLONG) } match self.iter().position(|b| *b == 0) { - Some(_) => Err(Error::from(Errno::EINVAL)), + Some(_) => Err(Errno::EINVAL), None => { unsafe { // TODO: Replace with bytes::copy_memory. rust-lang/rust#24028 -- cgit v1.2.3