Skip to content

Commit

Permalink
Merge #228
Browse files Browse the repository at this point in the history
228: Make clippy happy r=matklad a=jqnatividad

applied select clippy lint recommendations

Co-authored-by: Joel Natividad <[email protected]>
  • Loading branch information
bors[bot] and jqnatividad authored May 23, 2023
2 parents 3514863 + 39933cd commit 652015f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/imp_std.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ fn initialize_or_wait(queue: &AtomicPtr<Waiter>, mut init: Option<&mut dyn FnMut
return;
}
(INCOMPLETE, None) | (RUNNING, _) => {
wait(&queue, curr_queue);
wait(queue, curr_queue);
curr_queue = queue.load(Ordering::Acquire);
}
_ => debug_assert!(false),
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ pub mod unsync {
/// cell = OnceCell::new();
/// ```
pub fn take(&mut self) -> Option<T> {
mem::replace(self, Self::default()).into_inner()
mem::take(self).into_inner()
}

/// Consumes the `OnceCell`, returning the wrapped value.
Expand Down Expand Up @@ -1163,7 +1163,7 @@ pub mod sync {
/// cell = OnceCell::new();
/// ```
pub fn take(&mut self) -> Option<T> {
mem::replace(self, Self::default()).into_inner()
mem::take(self).into_inner()
}

/// Consumes the `OnceCell`, returning the wrapped value. Returns
Expand Down
2 changes: 1 addition & 1 deletion src/race.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ mod once_box {
Ordering::AcqRel,
Ordering::Acquire,
);
if let Err(_) = exchange {
if exchange.is_err() {
let value = unsafe { Box::from_raw(ptr) };
return Err(value);
}
Expand Down

0 comments on commit 652015f

Please sign in to comment.