misc: clippy: add map_unwrap_or

Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de>
On-behalf-of: SAP philipp.schuster@sap.com
This commit is contained in:
Philipp Schuster
2025-11-18 12:28:43 +01:00
committed by Rob Bradford
parent dda89d7027
commit d2b19bb969
8 changed files with 22 additions and 26 deletions

View File

@@ -1161,7 +1161,7 @@ fn main() {
if let Some(api_client::Error::ServerResponse(status_code, body)) =
error.downcast_ref::<api_client::Error>()
{
let body = body.as_ref().map(|body| body.as_str()).unwrap_or("");
let body = body.as_ref().map_or("", |body| body.as_str());
// Retrieve the list of error messages back.
let lines: Vec<&str> = match serde_json::from_str(body) {