diff options
-rw-r--r-- | askama_derive/src/generator.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/askama_derive/src/generator.rs b/askama_derive/src/generator.rs index 7384c1d..c20e171 100644 --- a/askama_derive/src/generator.rs +++ b/askama_derive/src/generator.rs @@ -1985,10 +1985,9 @@ where /// Iterates the scopes in reverse and returns `Some(LocalMeta)` /// from the first scope where `key` exists. fn get(&self, key: &K) -> Option<&V> { - let scopes = self.scopes.iter().rev(); + let mut scopes = self.scopes.iter().rev(); scopes - .filter_map(|set| set.get(key)) - .next() + .find_map(|set| set.get(key)) .or_else(|| self.parent.and_then(|set| set.get(key))) } |