From 8191ef76ce43c7592f9392171a8d1101b061d747 Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Sun, 26 Apr 2020 11:20:17 +0200 Subject: use ? instead of manual if-let --- src/event.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/event.rs b/src/event.rs index 558985e..71effba 100644 --- a/src/event.rs +++ b/src/event.rs @@ -219,11 +219,7 @@ impl Event { return None } - CbtStateChange::None => if let Some(kind) = check_activation(raw_event) { - kind - } else { - return None; - }, + CbtStateChange::None => check_activation(raw_event)?, }; Some(Event { time: raw_event.time, -- cgit v1.2.3