From f8d9a50a6658fc132661b592ffb9af5e4847596d Mon Sep 17 00:00:00 2001 From: Bulat Kurbanov Date: Tue, 14 Oct 2025 18:00:46 +0200 Subject: [PATCH] Remove unnecessary lifetime param and simplify error handling --- src/services/downloader/mod.rs | 2 +- src/services/downloader/types.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/services/downloader/mod.rs b/src/services/downloader/mod.rs index 3345d33..ad191d3 100644 --- a/src/services/downloader/mod.rs +++ b/src/services/downloader/mod.rs @@ -74,7 +74,7 @@ pub async fn download<'a>( Some((response, is_zip)) } -pub async fn download_chain<'a>( +pub async fn download_chain( book: BookWithRemote, file_type: String, source_config: config::SourceConfig, diff --git a/src/services/downloader/types.rs b/src/services/downloader/types.rs index 889b0b4..505ffab 100644 --- a/src/services/downloader/types.rs +++ b/src/services/downloader/types.rs @@ -20,7 +20,7 @@ pub struct DownloadResult { pub fn get_response_async_read(it: Response) -> impl AsyncRead { it.bytes_stream() - .map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e)) + .map_err(std::io::Error::other) .into_async_read() .compat() }