Skip to content

Commit aa7c4e4

Browse files
Nic-dormanclaude
andcommitted
style(data): satisfy clippy + rustfmt on streaming download
Drop redundant .into() on already-Bytes decrypt result (clippy useless_conversion) and apply rustfmt reflows in file.rs + e2e_file.rs. No behavior change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 9e55140 commit aa7c4e4

2 files changed

Lines changed: 4 additions & 8 deletions

File tree

ant-core/src/data/client/file.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2562,9 +2562,8 @@ impl Client {
25622562
// a bounded sink can apply backpressure.
25632563
let mut bytes_total = 0u64;
25642564
for chunk_result in stream {
2565-
let chunk: Bytes = chunk_result
2566-
.map_err(|e| Error::Encryption(format!("decryption failed: {e}")))?
2567-
.into();
2565+
let chunk: Bytes =
2566+
chunk_result.map_err(|e| Error::Encryption(format!("decryption failed: {e}")))?;
25682567
bytes_total += chunk.len() as u64;
25692568
on_chunk(chunk).await?;
25702569
}
@@ -2586,8 +2585,7 @@ impl Client {
25862585

25872586
let parent = output.parent().unwrap_or_else(|| Path::new("."));
25882587
let unique: u64 = rand::random();
2589-
let tmp_path =
2590-
parent.join(format!(".ant_download_{}_{unique}.tmp", std::process::id()));
2588+
let tmp_path = parent.join(format!(".ant_download_{}_{unique}.tmp", std::process::id()));
25912589

25922590
let mut file = std::fs::File::create(&tmp_path)?;
25932591
let write_result = self

ant-core/tests/e2e_file.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,7 @@ async fn test_file_download_to_sender_streaming() {
8989
// Channel item type is inferred from `file_download_to_sender`'s signature.
9090
let (tx, mut rx) = mpsc::channel(8);
9191
let data_map = result.data_map.clone();
92-
let dl = tokio::spawn(async move {
93-
client.file_download_to_sender(&data_map, tx, None).await
94-
});
92+
let dl = tokio::spawn(async move { client.file_download_to_sender(&data_map, tx, None).await });
9593

9694
let mut streamed: Vec<u8> = Vec::with_capacity(data.len());
9795
while let Some(item) = rx.recv().await {

0 commit comments

Comments
 (0)