diff options
author | Alan Somers <asomers@gmail.com> | 2021-09-19 08:29:31 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-19 08:29:31 -0600 |
commit | 515e99bcffcf324d03128649f3ee0ca14d67b5b1 (patch) | |
tree | 654a84d639d1feca971396f958f7589fc1fb81bf /src/sched.rs | |
parent | f0d6d0406d8e763619aecac062d1d2b56ca6e7b2 (diff) | |
parent | a09b1c8ac643d448db479a108ac6726307075453 (diff) | |
download | nix-515e99bcffcf324d03128649f3ee0ca14d67b5b1.zip |
Merge pull request #1529 from asomers/clippy-9-2021
Clippy cleanup
Diffstat (limited to 'src/sched.rs')
-rw-r--r-- | src/sched.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/sched.rs b/src/sched.rs index 69436fdf..c2dd7b84 100644 --- a/src/sched.rs +++ b/src/sched.rs @@ -15,7 +15,7 @@ mod sched_linux_like { use std::option::Option; use std::os::unix::io::RawFd; use crate::unistd::Pid; - use crate::{Error, Result}; + use crate::Result; // For some functions taking with a parameter of type CloneFlags, // only a subset of these flags have an effect. @@ -109,7 +109,7 @@ mod sched_linux_like { /// `field` is the CPU id to test pub fn is_set(&self, field: usize) -> Result<bool> { if field >= CpuSet::count() { - Err(Error::from(Errno::EINVAL)) + Err(Errno::EINVAL) } else { Ok(unsafe { libc::CPU_ISSET(field, &self.cpu_set) }) } @@ -119,7 +119,7 @@ mod sched_linux_like { /// `field` is the CPU id to add pub fn set(&mut self, field: usize) -> Result<()> { if field >= CpuSet::count() { - Err(Error::from(Errno::EINVAL)) + Err(Errno::EINVAL) } else { unsafe { libc::CPU_SET(field, &mut self.cpu_set); } Ok(()) @@ -130,7 +130,7 @@ mod sched_linux_like { /// `field` is the CPU id to remove pub fn unset(&mut self, field: usize) -> Result<()> { if field >= CpuSet::count() { - Err(Error::from(Errno::EINVAL)) + Err(Errno::EINVAL) } else { unsafe { libc::CPU_CLR(field, &mut self.cpu_set);} Ok(()) |