1
0
Fork 0
forked from wry/wry
wry/src/utils/cell_ext.rs
2024-03-02 18:09:40 +01:00

16 lines
288 B
Rust

use std::cell::Cell;
pub trait CellExt {
fn is_some(&self) -> bool;
fn is_none(&self) -> bool;
}
impl<T: Copy> CellExt for Cell<Option<T>> {
fn is_some(&self) -> bool {
self.get().is_some()
}
fn is_none(&self) -> bool {
self.get().is_none()
}
}