fairly_unsafe_cell 0.1.0

A hybrid between an UnsafeCell and a RefCell
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#![no_std]
#![allow(clippy::should_implement_trait)]

//! A hybrid between an [`UnsafeCell`](core::cell::UnsafeCell) and a [`RefCell`](core::cell::RefCell): comes with a [`RefCell`](core::cell::RefCell)-like but unsafe API that panics in test builds (`#[cfg(test)]`) when mutable access is not exclusive, but has no overhead (and allows for UB) in non-test builds.

#[cfg(test)]
mod checked;
#[cfg(test)]
pub use checked::*;

#[cfg(not(test))]
mod unchecked;
#[cfg(not(test))]
pub use unchecked::*;