Applied clippy fixes

This commit is contained in:
AB
2025-12-01 01:52:06 +02:00
parent 7c741c8e62
commit 67fe482a7c
3 changed files with 5 additions and 12 deletions

View File

@@ -56,8 +56,6 @@ pub fn create_outbound_object(uri: &str) -> config_models::Outbound {
let allow_insecure = data.allowInsecure == Some(String::from("true")) let allow_insecure = data.allowInsecure == Some(String::from("true"))
|| data.allowInsecure == Some(String::from("1")); || data.allowInsecure == Some(String::from("1"));
Outbound { Outbound {
protocol: name, protocol: name,
tag: String::from("proxy"), tag: String::from("proxy"),

View File

@@ -8,9 +8,7 @@ use serde_json::Value;
pub fn get_data(uri: &str) -> RawData { pub fn get_data(uri: &str) -> RawData {
let data = uri.split_once("vmess://").unwrap().1; let data = uri.split_once("vmess://").unwrap().1;
match general_purpose::STANDARD match general_purpose::STANDARD.decode(url_decode_str(data).unwrap_or(String::from(data))) {
.decode(url_decode_str(data).unwrap_or(String::from(data)))
{
Ok(decoded) => get_raw_data_from_base64(&decoded), Ok(decoded) => get_raw_data_from_base64(&decoded),
Err(_) => get_raw_data_from_uri(data), Err(_) => get_raw_data_from_uri(data),
} }

View File

@@ -24,8 +24,5 @@ pub fn parse_raw_json(input: &str) -> Option<serde_json::Value> {
} }
pub fn get_parameter_value(query: &Vec<(&str, &str)>, param: &str) -> Option<String> { pub fn get_parameter_value(query: &Vec<(&str, &str)>, param: &str) -> Option<String> {
query query.iter().find(|q| q.0 == param).map(|q| q.1.to_string())
.iter()
.find(|q| q.0 == param)
.map(|q| q.1.to_string())
} }