mirror of
https://github.com/house-of-vanity/v2-uri-parser.git
synced 2025-12-16 06:57:52 +00:00
Applied clippy fixes
This commit is contained in:
@@ -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"),
|
||||||
|
|||||||
@@ -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),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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())
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user