Skip to content

Commit 1107dd7

Browse files
authored
Flush streaming downloads from "cargo xtask download" (#8719)
This is another case like #8681 (See: https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=a9fdfeb0149e8ca0f84f3e164602da4e for an example) We need to flush after writing this data to ensure it actually leaves our process
1 parent de8072c commit 1107dd7

File tree

1 file changed

+1
-0
lines changed
  • dev-tools/downloader/src

1 file changed

+1
-0
lines changed

dev-tools/downloader/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ async fn streaming_download(url: &str, path: &Utf8Path) -> Result<()> {
275275
while let Some(chunk) = response.chunk().await? {
276276
tarball.write_all(chunk.as_ref()).await?;
277277
}
278+
tarball.flush().await?;
278279
Ok(())
279280
}
280281

0 commit comments

Comments
 (0)