From 0508140f40e378c2f1c137fccf7df717ca1f1e7d Mon Sep 17 00:00:00 2001 From: able Date: Wed, 21 Jun 2023 17:16:22 -0500 Subject: [PATCH] CLEANUP: turned if statement into match --- kernel/src/kmain.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/kernel/src/kmain.rs b/kernel/src/kmain.rs index 76dcedf..f4f0c65 100644 --- a/kernel/src/kmain.rs +++ b/kernel/src/kmain.rs @@ -61,11 +61,14 @@ pub fn kmain(cmdline: &str, bootstrap: Option<&'static [u8]>) -> ! { } } - let byte = sc.receive(); - if byte == b'\r' { - sc.send(b'\n'); + match sc.receive() { + b'\r' => { + sc.send(b'\n'); + } + byte => { + sc.send(byte); + } } - sc.send(byte); } } }