Improve names for uri prefix

This commit is contained in:
Keivan-sf
2025-07-27 21:54:03 +03:30
parent 65721cd5e3
commit e33e327079
2 changed files with 4 additions and 4 deletions

View File

@@ -56,11 +56,11 @@ fn parse_ss_address(raw_data: &str) -> models::ShadowSocksAddress {
let parsed = address_wo_slash.parse::<Uri>().unwrap();
let a = general_purpose::STANDARD
let method_and_password = general_purpose::STANDARD
.decode(url_decode_str(&userinfo).unwrap_or(userinfo))
.expect("User info is not base64");
let (method, password) = std::str::from_utf8(&a)
let (method, password) = std::str::from_utf8(&method_and_password)
.expect("Base64 did not yield a valid utf-8 string")
.split_once(":")
.expect("No `:` found in the decoded base64");

View File

@@ -57,7 +57,7 @@ fn parse_socks_address(raw_data: &str) -> models::SocksAddress {
return match maybe_userinfo {
Some(userinfo) => {
let url_decoded = url_decode_str(&userinfo).unwrap_or(userinfo);
let a = general_purpose::STANDARD
let username_and_password = general_purpose::STANDARD
.decode(url_decoded.clone())
.map(|a| {
String::from(
@@ -66,7 +66,7 @@ fn parse_socks_address(raw_data: &str) -> models::SocksAddress {
})
.unwrap_or(String::from(url_decoded.clone()));
let (username, password) = a
let (username, password) = username_and_password
.split_once(":")
.expect("No `:` found in the decoded base64");