summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorAlan Somers <asomers@gmail.com>2021-09-19 08:29:31 -0600
committerGitHub <noreply@github.com>2021-09-19 08:29:31 -0600
commit515e99bcffcf324d03128649f3ee0ca14d67b5b1 (patch)
tree654a84d639d1feca971396f958f7589fc1fb81bf /src/lib.rs
parentf0d6d0406d8e763619aecac062d1d2b56ca6e7b2 (diff)
parenta09b1c8ac643d448db479a108ac6726307075453 (diff)
downloadnix-515e99bcffcf324d03128649f3ee0ca14d67b5b1.zip
Merge pull request #1529 from asomers/clippy-9-2021
Clippy cleanup
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs6
1 files changed, 3 insertions, 3 deletions
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