#![warn(clippy::missing_inline_in_public_items)]
mod t_itself;
#[cfg(any(feature = "alloc", doc))]
mod box_container;
#[cfg(any(feature = "alloc", doc))]
mod rc;
#[cfg(any(feature = "alloc", doc))]
mod arc;
#[cfg(any(feature = "alloc", doc))]
mod rc_refcell;
#[cfg(any(feature = "alloc", doc))]
mod checked_rc_refcell;
#[cfg(any(feature = "std", doc))]
mod arc_rwlock;
#[cfg(any(feature = "std", doc))]
mod arc_mutex;
#[cfg(feature = "thread-checked-lock")]
mod arc_checked_mutex;
#[cfg(any(feature = "alloc", doc))]
pub use self::checked_rc_refcell::CheckedRcRefCell;
#[cfg(feature = "thread-checked-lock")]
pub use self::arc_checked_mutex::ErasedLockError;
#[cfg(any(feature = "std", doc))]
use std::sync::PoisonError;
#[cfg(any(feature = "std", doc))]
trait HandlePoisonedResult<T> {
#[must_use]
fn panic_if_poisoned(self) -> T;
#[must_use]
fn ignore_poisoned(self) -> T;
}
#[cfg(any(feature = "std", doc))]
impl<T> HandlePoisonedResult<T> for Result<T, PoisonError<T>> {
#[inline]
fn panic_if_poisoned(self) -> T {
#[expect(
clippy::unwrap_used,
reason = "if a panic occurred, there's a bug in whatever code led to that panic",
)]
self.unwrap()
}
#[inline]
fn ignore_poisoned(self) -> T {
match self {
Ok(t) => t,
Err(poison) => poison.into_inner(),
}
}
}