util.rs 671 B

12345678910111213141516171819202122232425262728
  1. use std::cell::Cell;
  2. use crate::innerlude::*;
  3. // create a cell with a "none" value
  4. #[inline]
  5. pub fn empty_cell() -> Cell<Option<ElementId>> {
  6. Cell::new(None)
  7. }
  8. // /// A helper type that lets scopes be ordered by their height
  9. // #[derive(Debug, Clone, Copy, PartialEq, Eq)]
  10. // pub struct HeightMarker {
  11. // pub idx: ScopeId,
  12. // pub height: u32,
  13. // }
  14. // impl Ord for HeightMarker {
  15. // fn cmp(&self, other: &Self) -> std::cmp::Ordering {
  16. // self.height.cmp(&other.height)
  17. // }
  18. // }
  19. // impl PartialOrd for HeightMarker {
  20. // fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
  21. // Some(self.cmp(other))
  22. // }
  23. // }