From 75fc661be121000debcafff88d2e2e1488f4435e Mon Sep 17 00:00:00 2001 From: Benedikt Bartscher Date: Fri, 29 May 2026 23:41:25 +0200 Subject: [PATCH] fix ci --- src/api.rs | 28 ++++++++++++---------------- src/bin/rbw/commands.rs | 3 +-- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/src/api.rs b/src/api.rs index a817fb26..3d8ad2be 100644 --- a/src/api.rs +++ b/src/api.rs @@ -1738,24 +1738,20 @@ fn classify_login_error(error_res: &ConnectErrorRes, code: u16) -> Error { "invalid_client" => { return Error::IncorrectApiKey; } - "" => { - // bitwarden_rs returns an empty error and error_description for - // this case, for some reason - if error_desc.is_none() || error_desc == Some("") { - if let Some(error_model) = error_res.error_model.as_ref() { - let message = error_model.message.as_str().to_string(); - match message.as_str() { - "Username or password is incorrect. Try again" - | "TOTP code is not a number" => { + // bitwarden_rs returns an empty error and error_description for + // this case, for some reason + "" if error_desc.is_none() || error_desc == Some("") => { + if let Some(error_model) = error_res.error_model.as_ref() { + let message = error_model.message.as_str().to_string(); + match message.as_str() { + "Username or password is incorrect. Try again" + | "TOTP code is not a number" => { + return Error::IncorrectPassword { message }; + } + s => { + if s.starts_with("Invalid TOTP code! Server time: ") { return Error::IncorrectPassword { message }; } - s => { - if s.starts_with( - "Invalid TOTP code! Server time: ", - ) { - return Error::IncorrectPassword { message }; - } - } } } } diff --git a/src/bin/rbw/commands.rs b/src/bin/rbw/commands.rs index bddf0efe..49586504 100644 --- a/src/bin/rbw/commands.rs +++ b/src/bin/rbw/commands.rs @@ -1507,8 +1507,7 @@ pub fn search( .filter(|entry| { entry .as_ref() - .map(|entry| entry.search_match(term, folder)) - .unwrap_or(true) + .map_or(true, |entry| entry.search_match(term, folder)) }) .map(|entry| entry.map(std::convert::Into::into)) .collect::>()?;