diff --git a/Cargo.lock b/Cargo.lock index ce32f9e..5f831a1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3079,7 +3079,7 @@ dependencies = [ [[package]] name = "quoter" -version = "0.5.0" +version = "0.5.1" dependencies = [ "actix", "actix-cors", diff --git a/Cargo.toml b/Cargo.toml index 5e5b253..c46dc28 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "quoter" -version = "0.5.0" +version = "0.5.1" edition = "2024" [dependencies] diff --git a/src/auth.rs b/src/auth.rs index 1a606f9..5df56eb 100644 --- a/src/auth.rs +++ b/src/auth.rs @@ -52,6 +52,7 @@ pub struct Author { } /// Получает айди пользователя из токена в заголовке +#[allow(clippy::collapsible_if)] pub async fn get_id_by_token(token: &str) -> Result> { let auth_api_base = env::var("CORE_URL")?; let query_name = "validate_jwt_token"; diff --git a/src/handlers/proxy.rs b/src/handlers/proxy.rs index ba4588a..f3a5a2d 100644 --- a/src/handlers/proxy.rs +++ b/src/handlers/proxy.rs @@ -19,6 +19,7 @@ fn create_cached_response(content_type: &str, data: Vec, file_etag: &str) -> } /// Обработчик для скачивания файла и генерации миниатюры, если она недоступна. +#[allow(clippy::collapsible_if)] pub async fn proxy_handler( req: HttpRequest, requested_res: web::Path, diff --git a/src/s3_utils.rs b/src/s3_utils.rs index 9a0520b..9d4f159 100644 --- a/src/s3_utils.rs +++ b/src/s3_utils.rs @@ -71,6 +71,7 @@ pub async fn load_file_from_s3( } /// Генерирует ключ с правильным расширением на основе MIME-типа. +#[allow(clippy::collapsible_if)] pub fn generate_key_with_extension(base_key: String, mime_type: String) -> String { let mime: mime::Mime = mime::Mime::from_str(&mime_type).unwrap_or(mime::APPLICATION_OCTET_STREAM); diff --git a/src/thumbnail.rs b/src/thumbnail.rs index 61282f2..888c19a 100644 --- a/src/thumbnail.rs +++ b/src/thumbnail.rs @@ -13,6 +13,7 @@ pub const THUMB_WIDTHS: [u32; 7] = [10, 40, 110, 300, 600, 800, 1400]; /// - "unsafe/1440x/production/image/439efaa0-816f-11ef-b201-439da98539bc.jpg" -> ("439efaa0-816f-11ef-b201-439da98539bc", 1440, "jpg") /// - "unsafe/production/image/5627e002-0c53-11ee-9565-0242ac110006.png" -> ("5627e002-0c53-11ee-9565-0242ac110006", 0, "png") /// - "unsafe/development/image/439efaa0-816f-11ef-b201-439da98539bc.jpg/webp" -> ("439efaa0-816f-11ef-b201-439da98539bc", 0, "webp") +#[allow(clippy::collapsible_if)] pub fn parse_file_path(requested_path: &str) -> (String, u32, String) { let mut path = requested_path.to_string(); if requested_path.ends_with("/webp") {