From 6a962c0eb3bb5c6254e0cfd2bea73c47fe4d8f0a Mon Sep 17 00:00:00 2001 From: Dennis Hamester Date: Tue, 26 Nov 2024 07:17:24 +0100 Subject: [PATCH] examples: downloader: Use an array for the SHA-256 --- examples/downloader/src/downloader.aldrin | 2 +- examples/downloader/src/main.rs | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/examples/downloader/src/downloader.aldrin b/examples/downloader/src/downloader.aldrin index 4399fcba..b00cd636 100644 --- a/examples/downloader/src/downloader.aldrin +++ b/examples/downloader/src/downloader.aldrin @@ -17,5 +17,5 @@ enum Chunk { Data @ 1 = bytes; /// The SHA-256 of the file. - Done @ 2 = bytes; + Done @ 2 = [u8; 32]; } diff --git a/examples/downloader/src/main.rs b/examples/downloader/src/main.rs index 6ae55a74..261bd3ad 100644 --- a/examples/downloader/src/main.rs +++ b/examples/downloader/src/main.rs @@ -281,9 +281,7 @@ async fn upload(bus: &Handle, args: UploadArgs) -> Result<()> { } let sha256 = sha256.finalize(); - sender - .send_item(&Chunk::Done(sha256.to_vec().into())) - .await?; + sender.send_item(&Chunk::Done(sha256.into())).await?; let duration = time.elapsed(); let mibps = size as f64 / duration.as_secs_f64() / 1024.0 / 1024.0;