mirror of
https://github.com/euzu/tuliprox.git
synced 2026-10-02 05:52:26 +02:00
fixed some clippy warnings
This commit is contained in:
@@ -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) => {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user