From fded32abc3818e3223d4914f01332df9465fdb7d Mon Sep 17 00:00:00 2001 From: Darius Date: Wed, 4 Dec 2024 13:43:39 -0500 Subject: [PATCH] chore: cleanup linting in test --- extensions/warp-ipfs/tests/community.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/extensions/warp-ipfs/tests/community.rs b/extensions/warp-ipfs/tests/community.rs index 93d511765..b9bcf63fe 100644 --- a/extensions/warp-ipfs/tests/community.rs +++ b/extensions/warp-ipfs/tests/community.rs @@ -4876,16 +4876,13 @@ mod test { ) .await?; - let mut bytes = vec![]; - loop { - match download_stream.next().await { - Some(b) => { - let mut b = b.unwrap().to_vec(); - bytes.append(&mut b); - } - None => break, - } + let mut bytes = Vec::with_capacity(file.len()); + + while let Some(result) = download_stream.next().await { + let b = result.expect("valid"); + bytes.extend(b.to_vec()); } + assert_eq!(bytes, file.to_vec()); let msg = instance_a