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