clippy + fmt

This commit is contained in:
nvrl committed 2026-06-30 03:29:40 +02:00
1 parent 9ec205f217
commit f702e56110
3 files changed
+7 -11

No files matched your search

+1 -6
View File
@@ -542,12 +542,7 @@ impl ProtonDriveClient {
/// Unlike [`download_file_to`](Self::download_file_to), a partial read /// Unlike [`download_file_to`](Self::download_file_to), a partial read
/// cannot recompute the full content manifest, so manifest-signature /// cannot recompute the full content manifest, so manifest-signature
/// verification is skipped. /// verification is skipped.
pub async fn download_range( pub async fn download_range(&self, uid: &NodeUid, offset: u64, length: u64) -> Result<Vec<u8>> {
&self,
uid: &NodeUid,
offset: u64,
length: u64,
) -> Result<Vec<u8>> {
let mut timer = self.telemetry.start("download_range"); let mut timer = self.telemetry.start("download_range");
let details = self let details = self
.get_link_details(&uid.volume_id, std::slice::from_ref(&uid.link_id)) .get_link_details(&uid.volume_id, std::slice::from_ref(&uid.link_id))
@@ -180,7 +180,8 @@ async fn download_range_single_block() {
let to = ((off + len) as usize).min(size); let to = ((off + len) as usize).min(size);
let want = &payload[from..to]; let want = &payload[from..to];
assert_eq!( assert_eq!(
got, want, got,
want,
"range(off={off}, len={len}) mismatch: got {} bytes, want {}", "range(off={off}, len={len}) mismatch: got {} bytes, want {}",
got.len(), got.len(),
want.len() want.len()
+4 -4
View File
@@ -277,14 +277,14 @@ impl ApiHttpClient {
) -> Result<reqwest::Response> { ) -> Result<reqwest::Response> {
// Don't bother refreshing for terminal account states. // Don't bother refreshing for terminal account states.
let bytes = response.bytes().await?; let bytes = response.bytes().await?;
if let Ok(envelope) = serde_json::from_slice::<ApiResponse>(&bytes) { if let Ok(envelope) = serde_json::from_slice::<ApiResponse>(&bytes)
if matches!( && matches!(
envelope.code, envelope.code,
ResponseCode::AccountDeleted | ResponseCode::AccountDisabled ResponseCode::AccountDeleted | ResponseCode::AccountDisabled
) { )
{
return Err(api_error(StatusCode::UNAUTHORIZED, &bytes)); return Err(api_error(StatusCode::UNAUTHORIZED, &bytes));
} }
}
let access_token = self.refresh_access_token(&rejected_access_token).await?; let access_token = self.refresh_access_token(&rejected_access_token).await?;
self.send_with_token(method, path, body, &access_token) self.send_with_token(method, path, body, &access_token)