1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-09 05:00:10 +00:00

clean up unwrap()

This commit is contained in:
Anders Åberg
2025-10-14 15:48:38 -07:00
parent a68fa10a47
commit e184d44eca

View File

@@ -224,7 +224,6 @@ enum SerializedMessage {
}
impl MacOSProviderClient {
// FIXME: Remove unwraps! They panic and terminate the whole application.
#[allow(clippy::unwrap_used)]
fn add_callback(&self, callback: Box<dyn Callback>) -> u32 {
let sequence_number = self
@@ -233,13 +232,12 @@ impl MacOSProviderClient {
self.response_callbacks_queue
.lock()
.unwrap()
.expect("response callbacks queue mutex should not be poisoned")
.insert(sequence_number, (callback, Instant::now()));
sequence_number
}
// FIXME: Remove unwraps! They panic and terminate the whole application.
#[allow(clippy::unwrap_used)]
fn send_message(
&self,
@@ -264,7 +262,7 @@ impl MacOSProviderClient {
if let Some((callback, _)) = self
.response_callbacks_queue
.lock()
.unwrap()
.expect("response callbacks queue mutex should not be poisoned")
.remove(&sequence_number)
{
callback.error(BitwardenError::Internal(format!(