fixed some clippy warnings

This commit is contained in:
euzu
2025-07-29 18:19:13 +02:00
parent 4ada26c207
commit 5128046647
3 changed files with 5 additions and 4 deletions
+3 -2
View File
@@ -150,7 +150,8 @@ impl ConfigInput {
let mut aliases: Vec<ConfigInputAlias> = batch_aliases.into_iter()
.map(ConfigInputAlias::from)
.collect();
if let Some(mut first) = aliases.remove(0) {
if !aliases.is_empty() {
let mut first = aliases.remove(0);
self.username = first.username.take();
self.password = first.password.take();
self.url = first.url.trim().to_string();
@@ -221,7 +222,7 @@ impl fmt::Display for ConfigInput {
pub fn get_batch_aliases(input_type: InputType, url: &str) -> Result<Option<(PathBuf, Vec<ConfigInputAliasDto>)>, TuliproxError> {
if input_type == InputType::M3uBatch || input_type == InputType::XtreamBatch {
return match utils::csv_read_inputs(input_type, url) {
Ok((file_path, mut batch_aliases)) => {
Ok((file_path, batch_aliases)) => {
Ok(Some((file_path, batch_aliases)))
}
Err(err) => {
+1 -1
View File
@@ -278,7 +278,7 @@ impl ConfigInputDto {
Ok(())
}
pub fn prepare_batch(&mut self, mut batch_aliases: Vec<ConfigInputAliasDto>) {
pub fn prepare_batch(&mut self, batch_aliases: Vec<ConfigInputAliasDto>) {
apply_batch_aliases!(self, batch_aliases);
}
}
+1 -1
View File
@@ -5,7 +5,7 @@ use serde::{Deserialize, Serialize};
pub const PROTOCOL_VERSION: u8 = 1;
#[derive(Default)]
#[derive(Default, PartialOrd, PartialEq, Debug, Clone)]
pub enum UserRole {
#[default]
Unauthorized,