You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR replaces all uses of `Box<dyn Iterator<Item=_> + 'a>`
in the `Element` and `ElementRef` APIs with generic associated
types. This means that heap allocations are no longer required
to iterate over annotations, sequence elements, or struct fields.
Because this change uses generic associated types, it also
configures the CI tests to use the beta channel of cargo. GATs will
be available in the next release of Rust (v1.65, out in November);
once that happens, we can and should switch back to
stable. (#443)
This change also removes the recently added dependency
on the `linkhash` crate. That dependency was originally pulled
in so structs could remember the order in which their fields were
inserted for later iteration. However, it only worked if the struct
did not contain duplicate field names. This PR changes the field
storage for `Struct` and `StructRef` to store their fields in a
`Vec` and also maintain a `HashMap<Symbol, IndexVec>`
that remembers all of the indexes at which values for a given
field can be found.
Further, it moves `Sequence` elements and `Struct` fields into
an `Rc` to make clone() operations cheaper. A future PR will
modify iterators over collection types to clone the `Rc` and
thus remove one of their lifetime constraints, making it much
easier to write a recursive iterator over an element tree without
constant cloning.
0 commit comments