chore(tvix/eval): add a marker for sorted borrowed attrs iteration

Similar to `into_iter_sorted`, add a marker function for call sites
that want *borrowed* sorted iteration.

Change-Id: I7c6f14e1ac43fdb14b861b3da183eb5d12bba139
Reviewed-on: https://cl.tvl.fyi/c/depot/+/9899
Autosubmit: tazjin <tazjin@tvl.su>
Reviewed-by: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
This commit is contained in:
Vincent Ambo 2023-11-02 18:43:43 +03:00 committed by clbot
parent d91fcd4f28
commit 2dd2b844c7

View file

@ -299,6 +299,12 @@ impl NixAttrs {
})
}
/// Same as iter(), but marks call sites which rely on the
/// iteration being lexicographic.
pub fn iter_sorted<'a>(&'a self) -> Iter<KeyValue<'a>> {
self.iter()
}
pub fn into_iter(self) -> IntoIter {
match self.0 {
AttrsRep::Empty => IntoIter(IntoIterRepr::Empty),