From e75e2ae5b6b6b1364368ceb3d4081b6508b2f001 Mon Sep 17 00:00:00 2001 From: Veetaha Date: Sun, 28 Jun 2020 04:02:03 +0300 Subject: Simlify with matches!() --- crates/ra_tt/src/buffer.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'crates/ra_tt') diff --git a/crates/ra_tt/src/buffer.rs b/crates/ra_tt/src/buffer.rs index 5967f44cd..02c771f70 100644 --- a/crates/ra_tt/src/buffer.rs +++ b/crates/ra_tt/src/buffer.rs @@ -105,10 +105,7 @@ impl<'a> Eq for Cursor<'a> {} impl<'a> Cursor<'a> { /// Check whether it is eof pub fn eof(self) -> bool { - match self.buffer.entry(&self.ptr) { - None | Some(Entry::End(None)) => true, - _ => false, - } + matches!(self.buffer.entry(&self.ptr), None | Some(Entry::End(None))) } /// If the cursor is pointing at the end of a subtree, returns -- cgit v1.2.3