Skip to content

Commit 09fe249

Browse files
committed
chore: add is_empty and iter methods to the ` struct for improved functionality.
1 parent 5b10500 commit 09fe249

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

rulog_vm/src/environment.rs

+8
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ impl Environment {
1919
self.bind(var, term);
2020
self
2121
}
22+
23+
pub fn is_empty(&self) -> bool {
24+
self.bindings.is_empty()
25+
}
26+
27+
pub fn iter(&self) -> std::collections::hash_map::Iter<String, Term> {
28+
self.bindings.iter()
29+
}
2230
}
2331

2432
impl FromIterator<(std::string::String, Term)> for Environment {

0 commit comments

Comments
 (0)