From aa572c9c40b19001cfcca9d5f108f3744031789b Mon Sep 17 00:00:00 2001 From: Turiiya <34311583+ttytm@users.noreply.github.com> Date: Sun, 3 Nov 2024 00:56:16 +0100 Subject: [PATCH] Use map_or instead of map followed by unwrap_or --- src/monitor.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/monitor.rs b/src/monitor.rs index 0dde185..7b2490f 100644 --- a/src/monitor.rs +++ b/src/monitor.rs @@ -166,8 +166,7 @@ impl Monitor { .find(&display_serial_key) .and_then(|x| x.downcast::()) .and_then(|x| x.to_i32()) - .map(|x| x as u32) - .unwrap_or(0); + .map_or(0, |x| x as u32); if display_vendor == display.vendor_number() && display_product == display.model_number()