Newtype VariableIterator.
This commit is contained in:
parent
5fe3d50762
commit
4aa647ddc5
1 changed files with 14 additions and 2 deletions
|
@ -264,6 +264,18 @@ impl Default for ConjoiningClauses {
|
|||
}
|
||||
}
|
||||
|
||||
pub struct VariableIterator<'a>(
|
||||
::std::collections::btree_map::Keys<'a, Variable, TypedValue>,
|
||||
);
|
||||
|
||||
impl<'a> Iterator for VariableIterator<'a> {
|
||||
type Item = &'a Variable;
|
||||
|
||||
fn next(&mut self) -> Option<&'a Variable> {
|
||||
self.0.next()
|
||||
}
|
||||
}
|
||||
|
||||
impl ConjoiningClauses {
|
||||
/// Construct a new `ConjoiningClauses` with the provided alias counter. This allows a caller
|
||||
/// to share a counter with an enclosing scope, and to start counting at a particular offset
|
||||
|
@ -370,8 +382,8 @@ impl ConjoiningClauses {
|
|||
}
|
||||
|
||||
/// Return an interator over the variables externally bound to values.
|
||||
pub fn value_bound_variables(&self) -> ::std::collections::btree_map::Keys<Variable, TypedValue> {
|
||||
self.value_bindings.keys()
|
||||
pub fn value_bound_variables(&self) -> VariableIterator {
|
||||
VariableIterator(self.value_bindings.keys())
|
||||
}
|
||||
|
||||
/// Return a set of the variables externally bound to values.
|
||||
|
|
Loading…
Reference in a new issue