This commit is contained in:
2024-05-07 18:12:54 +02:00
parent b8a7d7ccb1
commit 579f312206
2 changed files with 3 additions and 18 deletions

View File

@@ -42,10 +42,10 @@ pub async fn response_to_tempfile(res: &mut Response) -> Option<(SpooledTempFile
data_size += data.len(); data_size += data.len();
match tmp_file.write(data.chunk()) { match tmp_file.write_all(data.chunk()) {
Ok(_) => (), Ok(_) => {}
Err(_) => return None, Err(_) => return None,
} };
} }
tmp_file.seek(SeekFrom::Start(0)).unwrap(); tmp_file.seek(SeekFrom::Start(0)).unwrap();

View File

@@ -1,5 +1,3 @@
use std::fmt;
use reqwest::{Response, StatusCode}; use reqwest::{Response, StatusCode};
use serde::Deserialize; use serde::Deserialize;
@@ -11,19 +9,6 @@ pub struct FilenameData {
pub filename_ascii: String, pub filename_ascii: String,
} }
#[derive(Debug, Clone)]
struct DownloadError {
status_code: StatusCode,
}
impl fmt::Display for DownloadError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "Status code is {0}", self.status_code)
}
}
impl std::error::Error for DownloadError {}
pub async fn download_from_downloader( pub async fn download_from_downloader(
source_id: u32, source_id: u32,
remote_id: u32, remote_id: u32,