From 959581d0b3f4429c9df33a6366c6af234b6cdd04 Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Thu, 21 Nov 2024 18:05:37 +0400 Subject: [PATCH] style: replace match{state=} with state=if{} --- src/markdown.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/markdown.rs b/src/markdown.rs index 00d85e4..0adafc3 100644 --- a/src/markdown.rs +++ b/src/markdown.rs @@ -241,14 +241,11 @@ pub fn compile_markdown( _ => {} } - match state { - State::Metadata(false) => { - state = State::Start; - } - _ => { - state = State::Paragraph; - } - } + state = if state == State::Metadata(false) { + State::Start + } else { + State::Paragraph + }; } Text(text) => {