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:
		
							parent
							
								
									d91fcd4f28
								
							
						
					
					
						commit
						2dd2b844c7
					
				
					 1 changed files with 6 additions and 0 deletions
				
			
		| 
						 | 
					@ -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 {
 | 
					    pub fn into_iter(self) -> IntoIter {
 | 
				
			||||||
        match self.0 {
 | 
					        match self.0 {
 | 
				
			||||||
            AttrsRep::Empty => IntoIter(IntoIterRepr::Empty),
 | 
					            AttrsRep::Empty => IntoIter(IntoIterRepr::Empty),
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue