(&self, init: F)
| 634 | /// Unsafe getter; caller must ensure no overlapping &mut borrows across reentrant edge_op calls. |
| 635 | #[allow(clippy::mut_from_ref)] |
| 636 | pub fn get_or_init<F: FnOnce() -> T>(&self, init: F) -> &mut T { |
| 637 | unsafe { |
| 638 | let ptr = self.0.get(); |
| 639 | if (*ptr).is_none() { *ptr = Some(init()); } |
| 640 | (*ptr).as_mut().unwrap() |
| 641 | } |
| 642 | } |
| 643 | } |
| 644 | |
| 645 | impl<T> Default for PluginCell<T> { |