jay-compositor 1.14.0

The Jay compositor
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use {crate::utils::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()
    }
}