mirror of
https://github.com/zhom/donutbrowser.git
synced 2026-08-28 21:50:46 +02:00
chore: linting
This commit is contained in:
@@ -1243,7 +1243,7 @@ impl AppAutoUpdater {
|
|||||||
if !log_content.is_empty() {
|
if !log_content.is_empty() {
|
||||||
log::info!(
|
log::info!(
|
||||||
"Log file content (last 500 chars): {}",
|
"Log file content (last 500 chars): {}",
|
||||||
&log_content
|
log_content
|
||||||
.chars()
|
.chars()
|
||||||
.rev()
|
.rev()
|
||||||
.take(500)
|
.take(500)
|
||||||
|
|||||||
@@ -1298,10 +1298,9 @@ impl ProxyManager {
|
|||||||
("socks5", rest) // Default socks to socks5
|
("socks5", rest) // Default socks to socks5
|
||||||
} else if let Some(rest) = line.strip_prefix("ss://") {
|
} else if let Some(rest) = line.strip_prefix("ss://") {
|
||||||
("ss", rest)
|
("ss", rest)
|
||||||
} else if let Some(rest) = line.strip_prefix("shadowsocks://") {
|
|
||||||
("ss", rest)
|
|
||||||
} else {
|
} else {
|
||||||
return None;
|
let rest = line.strip_prefix("shadowsocks://")?;
|
||||||
|
("ss", rest)
|
||||||
};
|
};
|
||||||
|
|
||||||
// Check if there's auth (contains @)
|
// Check if there's auth (contains @)
|
||||||
@@ -1365,13 +1364,12 @@ impl ProxyManager {
|
|||||||
let host_port = &line[at_pos + 1..];
|
let host_port = &line[at_pos + 1..];
|
||||||
|
|
||||||
// Parse auth
|
// Parse auth
|
||||||
let (username, password) = if let Some(colon_pos) = auth.find(':') {
|
let (username, password) = {
|
||||||
|
let colon_pos = auth.find(':')?;
|
||||||
(
|
(
|
||||||
Some(auth[..colon_pos].to_string()),
|
Some(auth[..colon_pos].to_string()),
|
||||||
Some(auth[colon_pos + 1..].to_string()),
|
Some(auth[colon_pos + 1..].to_string()),
|
||||||
)
|
)
|
||||||
} else {
|
|
||||||
return None;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Parse host:port
|
// Parse host:port
|
||||||
|
|||||||
Reference in New Issue
Block a user