From 13e2a980993dba708bc3b52694c1499f8a269437 Mon Sep 17 00:00:00 2001 From: Zoran Cvetkov Date: Mon, 9 Dec 2024 21:56:43 +0200 Subject: [PATCH] address review --- graph/src/blockchain/block_stream.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/graph/src/blockchain/block_stream.rs b/graph/src/blockchain/block_stream.rs index 8c1bd31bb0c..1fc3c7efc01 100644 --- a/graph/src/blockchain/block_stream.rs +++ b/graph/src/blockchain/block_stream.rs @@ -455,12 +455,12 @@ async fn get_entities_for_range( from: BlockNumber, to: BlockNumber, ) -> Result>, Error> { - let mut entity_types = vec![]; - for entity_name in &filter.entities { - let entity_type = schema.entity_type(entity_name)?; - entity_types.push(entity_type); - } - Ok(store.get_range(entity_types, CausalityRegion::ONCHAIN, from..to)?) + let entity_types: Result> = filter + .entities + .iter() + .map(|name| schema.entity_type(name)) + .collect(); + Ok(store.get_range(entity_types?, CausalityRegion::ONCHAIN, from..to)?) } impl TriggersAdapterWrapper {