From 47747cd4120e260a144242aadd7732e11d133fe4 Mon Sep 17 00:00:00 2001 From: Clemens Wasser Date: Mon, 7 Jun 2021 13:59:01 +0200 Subject: Apply some clippy suggestions --- crates/mbe/src/tt_iter.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'crates/mbe/src/tt_iter.rs') diff --git a/crates/mbe/src/tt_iter.rs b/crates/mbe/src/tt_iter.rs index 5a4eca7bf..65da83476 100644 --- a/crates/mbe/src/tt_iter.rs +++ b/crates/mbe/src/tt_iter.rs @@ -121,10 +121,11 @@ impl<'a> TtIter<'a> { parser::parse_fragment(&mut src, &mut sink, fragment_kind); - let mut err = None; - if !sink.cursor.is_root() || sink.error { - err = Some(err!("expected {:?}", fragment_kind)); - } + let mut err = if !sink.cursor.is_root() || sink.error { + Some(err!("expected {:?}", fragment_kind)) + } else { + None + }; let mut curr = buffer.begin(); let mut res = vec![]; -- cgit v1.2.3