Skip to content

Commit

Permalink
fix(ci): fix clippy error due to Send not being general
Browse files Browse the repository at this point in the history
  • Loading branch information
RolandSherwin committed Jan 9, 2024
1 parent 8692795 commit a255ecd
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions sn_client/src/files/download.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,12 @@ impl FilesDownload {

let client_clone = self.api.client.clone();
let show_holders = self.show_holders;
let mut stream = futures::stream::iter(chunk_infos.iter())
// the initial index is not always 0 as we might seek a range of bytes. So fetch the first index
let mut current_index = chunk_infos
.first()
.ok_or_else(|| ClientError::EmptyDataMap)?
.index;
let mut stream = futures::stream::iter(chunk_infos.into_iter())
.map(|chunk_info| {
Self::get_chunk(
client_clone.clone(),
Expand All @@ -359,11 +364,7 @@ impl FilesDownload {
.buffer_unordered(self.batch_size);

let mut chunk_download_cache = HashMap::new();
// the initial index is not always 0 as we might seek a range of bytes. So fetch the first index
let mut current_index = chunk_infos
.first()
.ok_or_else(|| ClientError::EmptyDataMap)?
.index;

while let Some(result) = stream.next().await {
let (chunk_address, index, encrypted_chunk) = result?;
// notify about the download
Expand Down

0 comments on commit a255ecd

Please sign in to comment.