Skip to content

Commit

Permalink
Minor tweaks.
Browse files Browse the repository at this point in the history
  • Loading branch information
reitermarkus committed Sep 7, 2022
1 parent 42e9c79 commit ff0a4ba
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib.rs
Expand Up @@ -490,7 +490,7 @@ pub mod unsync {
#[cfg(feature = "critical-section")]
#[inline]
pub(crate) unsafe fn get_unchecked(&self) -> &T {
crate::unwrap_unchecked(self.get())
unwrap_unchecked(self.get())
}

/// Sets the contents of this cell to `value`.
Expand Down Expand Up @@ -1380,11 +1380,13 @@ pub mod sync {
pub mod race;

#[cfg(feature = "sync")]
#[track_caller]
#[inline]
unsafe fn take_unchecked<T>(val: &mut Option<T>) -> T {
unwrap_unchecked(val.take())
}

#[track_caller]
#[inline]
unsafe fn unwrap_unchecked<T>(val: Option<T>) -> T {
match val {
Expand Down

0 comments on commit ff0a4ba

Please sign in to comment.