1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-10 21:33:27 +00:00

Fix Clippy 1.88 warnings (#15396)

* Fix Clippy 1.88 warnings

* Fmt
This commit is contained in:
Daniel García
2025-07-01 22:36:18 +02:00
committed by GitHub
parent 3f7cb674af
commit 616ac9a3c8
6 changed files with 15 additions and 33 deletions

View File

@@ -51,7 +51,7 @@ impl ssh_agent::Agent<peerinfo::models::PeerInfo> for BitwardenDesktopAgent {
let request_data = match request_parser::parse_request(data) {
Ok(data) => data,
Err(e) => {
println!("[SSH Agent] Error while parsing request: {}", e);
println!("[SSH Agent] Error while parsing request: {e}");
return false;
}
};
@@ -178,7 +178,7 @@ impl BitwardenDesktopAgent {
);
}
Err(e) => {
eprintln!("[SSH Agent Native Module] Error while parsing key: {}", e);
eprintln!("[SSH Agent Native Module] Error while parsing key: {e}");
}
}
}
@@ -234,10 +234,9 @@ fn parse_key_safe(pem: &str) -> Result<ssh_key::private::PrivateKey, anyhow::Err
Ok(key) => match key.public_key().to_bytes() {
Ok(_) => Ok(key),
Err(e) => Err(anyhow::Error::msg(format!(
"Failed to parse public key: {}",
e
"Failed to parse public key: {e}"
))),
},
Err(e) => Err(anyhow::Error::msg(format!("Failed to parse key: {}", e))),
Err(e) => Err(anyhow::Error::msg(format!("Failed to parse key: {e}"))),
}
}

View File

@@ -65,16 +65,10 @@ impl BitwardenDesktopAgent {
}
};
println!(
"[SSH Agent Native Module] Starting SSH Agent server on {:?}",
ssh_path
);
println!("[SSH Agent Native Module] Starting SSH Agent server on {ssh_path:?}");
let sockname = std::path::Path::new(&ssh_path);
if let Err(e) = std::fs::remove_file(sockname) {
println!(
"[SSH Agent Native Module] Could not remove existing socket file: {}",
e
);
println!("[SSH Agent Native Module] Could not remove existing socket file: {e}");
if e.kind() != std::io::ErrorKind::NotFound {
return;
}
@@ -85,10 +79,7 @@ impl BitwardenDesktopAgent {
// Only the current user should be able to access the socket
if let Err(e) = fs::set_permissions(sockname, fs::Permissions::from_mode(0o600))
{
println!(
"[SSH Agent Native Module] Could not set socket permissions: {}",
e
);
println!("[SSH Agent Native Module] Could not set socket permissions: {e}");
return;
}
@@ -112,10 +103,7 @@ impl BitwardenDesktopAgent {
println!("[SSH Agent Native Module] SSH Agent server exited");
}
Err(e) => {
eprintln!(
"[SSH Agent Native Module] Error while starting agent server: {}",
e
);
eprintln!("[SSH Agent Native Module] Error while starting agent server: {e}");
}
}
});

View File

@@ -214,8 +214,7 @@ impl MacOSProviderClient {
.remove(&sequence_number)
{
cb.error(BitwardenError::Internal(format!(
"Error sending message: {}",
e
"Error sending message: {e}"
)));
}
}

View File

@@ -237,7 +237,7 @@ pub mod sshagent {
.expect("should be able to send auth response to agent");
}
Err(e) => {
println!("[SSH Agent Native Module] calling UI callback promise was rejected: {}", e);
println!("[SSH Agent Native Module] calling UI callback promise was rejected: {e}");
let _ = auth_response_tx_arc
.lock()
.await
@@ -246,7 +246,7 @@ pub mod sshagent {
}
},
Err(e) => {
println!("[SSH Agent Native Module] calling UI callback could not create promise: {}", e);
println!("[SSH Agent Native Module] calling UI callback could not create promise: {e}");
let _ = auth_response_tx_arc
.lock()
.await

View File

@@ -80,8 +80,7 @@ mod objc {
Ok(value) => value,
Err(e) => {
println!(
"Error: Failed to convert ObjCString to Rust string during commandReturn: {}",
e
"Error: Failed to convert ObjCString to Rust string during commandReturn: {e}"
);
return false;
@@ -91,10 +90,7 @@ mod objc {
match context.send(value) {
Ok(_) => 0,
Err(e) => {
println!(
"Error: Failed to return ObjCString from ObjC code to Rust code: {}",
e
);
println!("Error: Failed to return ObjCString from ObjC code to Rust code: {e}");
return false;
}

View File

@@ -29,12 +29,12 @@ fn init_logging(log_path: &Path, console_level: LevelFilter, file_level: LevelFi
loggers.push(simplelog::WriteLogger::new(file_level, config, file));
}
Err(e) => {
eprintln!("Can't create file: {}", e);
eprintln!("Can't create file: {e}");
}
}
if let Err(e) = CombinedLogger::init(loggers) {
eprintln!("Failed to initialize logger: {}", e);
eprintln!("Failed to initialize logger: {e}");
}
}