From 144bce7707520e58e11ad0d6e5433d870b56494c Mon Sep 17 00:00:00 2001 From: René Kijewski Date: Wed, 15 Jun 2022 22:27:30 +0200 Subject: Replace .filter_map().next() with .filter_map() --- askama_derive/src/generator.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'askama_derive/src/generator.rs') 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))) } -- cgit