yrs/utils/
mod.rs

1pub mod client_hasher;
2
3pub(crate) trait OptionExt<T> {
4    fn get_or_init(&mut self) -> &mut T;
5}
6
7impl<T: Default> OptionExt<T> for Option<Box<T>> {
8    fn get_or_init(&mut self) -> &mut T {
9        self.get_or_insert_with(|| Box::new(T::default()))
10    }
11}