From 1396b5abec41933adbdf968fd16895fed4797a3f Mon Sep 17 00:00:00 2001 From: Marko Atanasievski Date: Fri, 16 Aug 2024 12:08:57 +0200 Subject: [PATCH] fix: review --- zero_bin/rpc/src/lib.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/zero_bin/rpc/src/lib.rs b/zero_bin/rpc/src/lib.rs index 16790c549..711184f4c 100644 --- a/zero_bin/rpc/src/lib.rs +++ b/zero_bin/rpc/src/lib.rs @@ -88,12 +88,11 @@ where .into_iter() .map(|mut chunk| { // We convert to tuple of (current, Option previous block) - if let Some(first) = chunk.next() { - let second = chunk.next(); - (first, second) - } else { - panic!("not possible according to itertools::Iterator::chunks definition") - } + let first = chunk + .next() + .expect("must be valid according to itertools::Iterator::chunks definition"); + let second = chunk.next(); + (first, second) }) .collect::>();