From 12f1ac2c12ee979213ecea3c7a535acd9a16637c Mon Sep 17 00:00:00 2001 From: Ivan Druzhitskiy Date: Fri, 11 Aug 2023 16:26:05 +0300 Subject: [PATCH] change futures to for --- bob-backend/src/core.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bob-backend/src/core.rs b/bob-backend/src/core.rs index dab8f0fb..eedb24bf 100644 --- a/bob-backend/src/core.rs +++ b/bob-backend/src/core.rs @@ -349,10 +349,8 @@ impl Backend { let mut all_result = Err(Error::key_not_found(key)); if let Some(paths) = disk_paths { trace!("GET[{}] try read normal", key); - let mut futures: FuturesUnordered<_> = paths.into_iter().map(|path| { - self.get_local(key, Operation::new_local(vdisk_id, path)) - }).collect(); - while let Some(result) = futures.next().await { + for path in paths { + let result = self.get_local(key, Operation::new_local(vdisk_id, path)).await; match result { Ok(data) => return Ok(data), Err(_) => continue,