aboutsummaryrefslogtreecommitdiffstats
path: root/askama_derive/src
diff options
context:
space:
mode:
authorLibravatar René Kijewski <kijewski@library.vetmed.fu-berlin.de>2022-06-15 22:27:30 +0200
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2022-06-15 22:44:16 +0200
commit144bce7707520e58e11ad0d6e5433d870b56494c (patch)
treebfb2b081c0c8be4aa2d0a17b91cf02b223ee41ff /askama_derive/src
parentb7f12bb25d86c4b34895be551412b8f45c95ea32 (diff)
downloadaskama-144bce7707520e58e11ad0d6e5433d870b56494c.tar.gz
askama-144bce7707520e58e11ad0d6e5433d870b56494c.tar.bz2
askama-144bce7707520e58e11ad0d6e5433d870b56494c.zip
Replace .filter_map().next() with .filter_map()
Diffstat (limited to '')
-rw-r--r--askama_derive/src/generator.rs5
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)))
}