diff options
author | René Kijewski <kijewski@library.vetmed.fu-berlin.de> | 2022-06-15 22:27:30 +0200 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2022-06-15 22:44:16 +0200 |
commit | 144bce7707520e58e11ad0d6e5433d870b56494c (patch) | |
tree | bfb2b081c0c8be4aa2d0a17b91cf02b223ee41ff | |
parent | b7f12bb25d86c4b34895be551412b8f45c95ea32 (diff) | |
download | askama-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.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))) } |