diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2019-11-10 02:07:43 +0100 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2019-12-22 02:03:35 +0100 |
commit | ecaa1585b994221bb4a6db749eb73384af6ff12b (patch) | |
tree | 4bfb91cb34186509a838a0b0f86d38379b39b0ed | |
parent | 59f15b41bc58b776e47041b168cdae11dc94e599 (diff) |
Bind value and simplify condition with it
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
-rw-r--r-- | bin/domain/imag-calendar/src/util.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/bin/domain/imag-calendar/src/util.rs b/bin/domain/imag-calendar/src/util.rs index 8c0994ba..469c2e92 100644 --- a/bin/domain/imag-calendar/src/util.rs +++ b/bin/domain/imag-calendar/src/util.rs @@ -160,7 +160,7 @@ pub fn find_event_by_id<'a>(store: &'a Store, id: &str, refconfig: &Config) -> R trace!("Checking whether {} is represented by {}", id, event.get_location()); let parsed = ParsedEventFLE::parse(event, refconfig)?; - if parsed + let found = parsed .get_data() .events() .any(|event| { @@ -177,8 +177,9 @@ pub fn find_event_by_id<'a>(store: &'a Store, id: &str, refconfig: &Config) -> R } take - }) - { + }); + + if found { return Ok(Some(parsed)) } } |