make vars-by-symbol a vector

This commit is contained in:
Folkert 2022-03-01 20:42:30 +01:00
parent d4cce420a8
commit 19d7f7ce09
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
3 changed files with 10 additions and 8 deletions

View file

@ -84,11 +84,11 @@ pub struct Env {
}
impl Env {
pub fn vars_by_symbol(&self) -> MutMap<Symbol, Variable> {
pub fn vars_by_symbol(&self) -> impl Iterator<Item = (Symbol, Variable)> + '_ {
let it1 = self.symbols.iter().copied();
let it2 = self.variables.iter().copied();
it1.zip(it2).collect()
it1.zip(it2)
}
fn get_var_by_symbol(&self, symbol: &Symbol) -> Option<Variable> {