Return a Fold struct when querying the FoldMap

This contains a new `id` field that lets us distinguish among folds.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Antonio Scandurra 2023-11-15 17:09:59 +01:00
parent 851a60a68e
commit 3ff8c78b58
6 changed files with 87 additions and 48 deletions

View file

@ -2471,7 +2471,7 @@ impl From<SmallVec<[u32; 16]>> for StackingOrder {
#[derive(Clone, Debug, Eq, PartialEq, Hash)]
pub enum ElementId {
View(EntityId),
Number(usize),
Integer(usize),
Name(SharedString),
FocusHandle(FocusId),
}
@ -2484,13 +2484,13 @@ impl From<EntityId> for ElementId {
impl From<usize> for ElementId {
fn from(id: usize) -> Self {
ElementId::Number(id)
ElementId::Integer(id)
}
}
impl From<i32> for ElementId {
fn from(id: i32) -> Self {
Self::Number(id as usize)
Self::Integer(id as usize)
}
}