diff --git a/crates/types/src/compound/enumerated.rs b/crates/types/src/compound/enumerated.rs index b35d687..dbef77d 100644 --- a/crates/types/src/compound/enumerated.rs +++ b/crates/types/src/compound/enumerated.rs @@ -110,11 +110,11 @@ where impl EnumRequirements for Enum<(), L> where L: list::Meta + Indexable, - list::ElementAt: Copy + DiscriminantCodable<<::Length as PeanoNonZero>::Prev>, + list::ElementAt: DiscriminantCodable<<::Length as PeanoNonZero>::Prev>, { type MaxDiscr = <::Length as PeanoNonZero>::Prev; fn discr(&self) -> Discr { - self.1.get().discr() + self.1.get_ref().discr() } } diff --git a/crates/types/src/compound/list/flat.rs b/crates/types/src/compound/list/flat.rs index a2711bf..8f08062 100644 --- a/crates/types/src/compound/list/flat.rs +++ b/crates/types/src/compound/list/flat.rs @@ -32,6 +32,7 @@ impl Node { pub trait Indexable { type Element; fn get(&self) -> Self::Element where Self::Element: Copy; + fn get_ref(&self) -> &Self::Element; } impl Indexable for Node { @@ -39,6 +40,9 @@ impl Indexable for Node { fn get(&self) -> Self::Element where Self::Element: Copy { self.head } + fn get_ref(&self) -> &Self::Element { + &self.head + } } impl Indexable for Node> { @@ -46,6 +50,9 @@ impl Indexable for Node> { fn get(&self) -> Self::Element where Self::Element: Copy { self.tail.head } + fn get_ref(&self) -> &Self::Element { + &self.tail.head + } } impl Indexable for Node>> { @@ -53,6 +60,9 @@ impl Indexable for Node>> { fn get(&self) -> Self::Element where Self::Element: Copy { self.tail.tail.head } + fn get_ref(&self) -> &Self::Element { + &self.tail.tail.head + } } impl Indexable for Node>>> { @@ -60,6 +70,9 @@ impl Indexable for Node fn get(&self) -> Self::Element where Self::Element: Copy { self.tail.tail.tail.head } + fn get_ref(&self) -> &Self::Element { + &self.tail.tail.tail.head + } } pub trait IntoList {