all: split reusable components into workspace crates
This commit is contained in:
parent
2a079ed800
commit
657e7ce2f7
225 changed files with 7422 additions and 17602 deletions
|
|
@ -1,27 +0,0 @@
|
|||
use {crate::utils::clonecell::CloneCell, std::rc::Rc};
|
||||
|
||||
pub struct Opt<T> {
|
||||
t: CloneCell<Option<Rc<T>>>,
|
||||
}
|
||||
|
||||
impl<T> Default for Opt<T> {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
t: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> Opt<T> {
|
||||
pub fn set(&self, t: Option<Rc<T>>) {
|
||||
self.t.set(t);
|
||||
}
|
||||
|
||||
pub fn get(&self) -> Option<Rc<T>> {
|
||||
self.t.get()
|
||||
}
|
||||
|
||||
pub fn is_none(&self) -> bool {
|
||||
self.t.is_none()
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue