Skip to content

Commit 3ce5bca

Browse files
committed
fixes clippy::borrow_as_ptr
1 parent 7124976 commit 3ce5bca

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/affinity.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub fn get(pid: libc::pid_t) -> Result<Vec<usize>> {
1212
let mut mask = std::mem::zeroed();
1313
libc::CPU_ZERO(&mut mask);
1414

15-
if 0 != libc::sched_getaffinity(pid, CPU_SET_SIZE, &mut mask) {
15+
if 0 != libc::sched_getaffinity(pid, CPU_SET_SIZE, &raw mut mask) {
1616
return Err(anyhow!("sched_getaffinity: {}", errno()));
1717
}
1818

@@ -40,7 +40,7 @@ pub fn set(pid: libc::pid_t, cpuset: &[usize]) -> Result<()> {
4040
libc::CPU_SET(*i, &mut mask);
4141
}
4242

43-
if 0 != libc::sched_setaffinity(pid, CPU_SET_SIZE, &mask) {
43+
if 0 != libc::sched_setaffinity(pid, CPU_SET_SIZE, &raw const mask) {
4444
return Err(anyhow!("sched_setaffinity: {}", errno()));
4545
}
4646
};

0 commit comments

Comments
 (0)