Skip to content

Commit

Permalink
examples: downloader: Use an array for the SHA-256
Browse files Browse the repository at this point in the history
  • Loading branch information
dennis-hamester committed Nov 26, 2024
1 parent 3ff2eba commit 6a962c0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/downloader/src/downloader.aldrin
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ enum Chunk {
Data @ 1 = bytes;

/// The SHA-256 of the file.
Done @ 2 = bytes;
Done @ 2 = [u8; 32];
}
4 changes: 1 addition & 3 deletions examples/downloader/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6a962c0

Please sign in to comment.