From 962a4e7d983e45910622746ae3501b5bfddcf318 Mon Sep 17 00:00:00 2001 From: euzu Date: Thu, 2 Jan 2025 08:18:16 +0100 Subject: [PATCH] clippy fixes --- src/api/api_utils.rs | 2 +- src/api/xtream_api.rs | 2 +- src/processing/affix_processor.rs | 1 - src/repository/epg_repository.rs | 1 - src/utils/download.rs | 2 +- src/utils/mod.rs | 2 +- 6 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/api/api_utils.rs b/src/api/api_utils.rs index 59dcf14d2..2bdb9a35a 100644 --- a/src/api/api_utils.rs +++ b/src/api/api_utils.rs @@ -12,7 +12,7 @@ use async_std::prelude::Stream; use async_std::stream::StreamExt; use bytes::Bytes; use chrono::Utc; -use log::{debug, error, Level}; +use log::{debug, error}; use std::collections::HashMap; use std::path::Path; use std::sync::Arc; diff --git a/src/api/xtream_api.rs b/src/api/xtream_api.rs index c58f935b0..0589cdb11 100644 --- a/src/api/xtream_api.rs +++ b/src/api/xtream_api.rs @@ -10,7 +10,7 @@ use actix_web::{web, HttpRequest, HttpResponse}; use bytes::Bytes; use futures::stream::{self, StreamExt}; use futures::Stream; -use log::{debug, error, warn, Level}; +use log::{debug, error, warn}; use serde_json::{Map, Value}; use crate::m3u_filter_error::{M3uFilterError, M3uFilterErrorKind}; diff --git a/src/processing/affix_processor.rs b/src/processing/affix_processor.rs index 7ce3e435a..cc9fe8740 100644 --- a/src/processing/affix_processor.rs +++ b/src/processing/affix_processor.rs @@ -1,7 +1,6 @@ use crate::model::config::{ConfigInput, InputAffix, AFFIX_FIELDS}; use crate::model::playlist::{FetchedPlaylist, FieldAccessor, PlaylistItem}; use crate::{debug_if_enabled, valid_property}; -use log::{Level}; type AffixProcessor<'a> = Box; diff --git a/src/repository/epg_repository.rs b/src/repository/epg_repository.rs index f69329d62..69b4695c0 100644 --- a/src/repository/epg_repository.rs +++ b/src/repository/epg_repository.rs @@ -1,7 +1,6 @@ use std::fs::File; use std::io::{Cursor, Write}; use std::path::{Path}; -use log::{Level}; use quick_xml::{Writer}; use crate::{debug_if_enabled, notify_err}; use crate::m3u_filter_error::{M3uFilterError, M3uFilterErrorKind}; diff --git a/src/utils/download.rs b/src/utils/download.rs index a42fd3cbc..73d0190c3 100644 --- a/src/utils/download.rs +++ b/src/utils/download.rs @@ -22,7 +22,7 @@ fn prepare_file_path(persist: Option<&str>, working_dir: &str, action: &str) -> persist.map(|persist_path| file_utils::prepare_persist_path(persist_path, action)); if persist_file.is_some() { let file_path = file_utils::get_file_path(working_dir, persist_file); - debug_if_enabled!("persist to file: {}", file_path.as_ref().map(|p| p.to_string_lossy()).unwrap_or(Cow::from("?"))); + debug_if_enabled!("persist to file: {}", file_path.as_ref().map_or(Cow::from("?"), |p| p.to_string_lossy())); file_path } else { None diff --git a/src/utils/mod.rs b/src/utils/mod.rs index a0a0790c4..fa04b6cbe 100644 --- a/src/utils/mod.rs +++ b/src/utils/mod.rs @@ -15,7 +15,7 @@ pub mod directed_graph; macro_rules! debug_if_enabled { ($fmt:expr, $( $args:expr ),*) => { if log::log_enabled!(log::Level::Debug) { - log::log!(Level::Debug, $fmt, $($args),*); + log::log!(log::Level::Debug, $fmt, $($args),*); } };