mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2025-05-20 07:26:58 -04:00
Update format
This commit is contained in:
@@ -30,9 +30,7 @@ pub fn normalize_server(server: &str) -> anyhow::Result<String> {
|
||||
.host_str()
|
||||
.ok_or(anyhow::anyhow!("Invalid server URL: missing host"))?;
|
||||
|
||||
let port: String = normalized_url
|
||||
.port()
|
||||
.map_or("".into(), |port| format!(":{}", port));
|
||||
let port: String = normalized_url.port().map_or("".into(), |port| format!(":{}", port));
|
||||
|
||||
let normalized_url = format!("{}://{}{}", scheme, host, port);
|
||||
|
||||
|
@@ -115,12 +115,7 @@ pub fn redact_uri(uri: &str) -> String {
|
||||
.map(|query| format!("?{}", query))
|
||||
.unwrap_or_default();
|
||||
|
||||
return format!(
|
||||
"{}://[**********]{}{}",
|
||||
url.scheme(),
|
||||
url.path(),
|
||||
redacted_query
|
||||
);
|
||||
return format!("{}://[**********]{}{}", url.scheme(), url.path(), redacted_query);
|
||||
}
|
||||
|
||||
let redacted_query = redact_query(url.query());
|
||||
@@ -165,10 +160,7 @@ mod tests {
|
||||
|
||||
redaction.add_value("foo").unwrap();
|
||||
|
||||
assert_eq!(
|
||||
redaction.redact_str("hello, foo, bar"),
|
||||
"hello, [**********], bar"
|
||||
);
|
||||
assert_eq!(redaction.redact_str("hello, foo, bar"), "hello, [**********], bar");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@@ -2,9 +2,7 @@ use tokio::signal;
|
||||
|
||||
pub async fn shutdown_signal() {
|
||||
let ctrl_c = async {
|
||||
signal::ctrl_c()
|
||||
.await
|
||||
.expect("failed to install Ctrl+C handler");
|
||||
signal::ctrl_c().await.expect("failed to install Ctrl+C handler");
|
||||
};
|
||||
|
||||
#[cfg(unix)]
|
||||
|
Reference in New Issue
Block a user