refactor: split cargo workspace
This commit is contained in:
parent
5db14936e7
commit
1c21bd1259
695 changed files with 32023 additions and 44964 deletions
16
crates/utils/src/cell_ext.rs
Normal file
16
crates/utils/src/cell_ext.rs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
use {crate::ptr_ext::PtrExt, std::cell::Cell};
|
||||
|
||||
pub trait CellExt {
|
||||
fn is_some(&self) -> bool;
|
||||
fn is_none(&self) -> bool;
|
||||
}
|
||||
|
||||
impl<T> CellExt for Cell<Option<T>> {
|
||||
fn is_some(&self) -> bool {
|
||||
unsafe { self.as_ptr().deref().is_some() }
|
||||
}
|
||||
|
||||
fn is_none(&self) -> bool {
|
||||
!self.is_some()
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue