oficina / docs Public
| 1 | pub mod client_hasher; |
| 2 | |
| 3 | pub(crate) trait OptionExt<T> { |
| 4 | fn get_or_init(&mut self) -> &mut T; |
| 5 | } |
| 6 | |
| 7 | impl<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 | } |
| 12 |