From a9cdc03341141e159bfd8c88c969f5e481ed6913 Mon Sep 17 00:00:00 2001 From: ondra05 Date: Thu, 18 Aug 2022 14:58:46 +0200 Subject: [PATCH] thing --- ablescript/src/brian.rs | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/ablescript/src/brian.rs b/ablescript/src/brian.rs index 183b261..65c5a0e 100644 --- a/ablescript/src/brian.rs +++ b/ablescript/src/brian.rs @@ -221,15 +221,7 @@ impl<'a, I: BootlegRead> Interpreter<'a, I> { }; Some((*counter, index)) }) - .find_map( - |(counter, index)| { - if counter == 0 { - Some(index) - } else { - None - } - }, - ) + .find_map(|(counter, index)| (counter == 0).then_some(index)) } fn get_matching_opening_bracket(&mut self, closing: usize) -> Option { @@ -245,15 +237,7 @@ impl<'a, I: BootlegRead> Interpreter<'a, I> { }; Some((*counter, index)) }) - .find_map( - |(counter, index)| { - if counter == 0 { - Some(index) - } else { - None - } - }, - ) + .find_map(|(counter, index)| (counter == 0).then_some(index)) } }