From 0b5ca8ee660801bc247e84fee7b144b20618fd57 Mon Sep 17 00:00:00 2001 From: Andrew Golovashevich Date: Mon, 24 Nov 2025 22:39:05 +0300 Subject: [PATCH] Minor code cleanup in ascii char --- src/ascii/char.rs | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/ascii/char.rs b/src/ascii/char.rs index 03e7bcd..ac8018a 100644 --- a/src/ascii/char.rs +++ b/src/ascii/char.rs @@ -1,19 +1,9 @@ +#[derive(Clone, Copy)] pub enum AsciiChar { NOT_ASCII, ASCII(u8), } -impl Clone for AsciiChar { - fn clone(&self) -> Self { - match self { - AsciiChar::NOT_ASCII => return AsciiChar::NOT_ASCII, - AsciiChar::ASCII(c) => return AsciiChar::ASCII(*c), - } - } -} - -impl Copy for AsciiChar {} - impl PartialEq for AsciiChar { fn eq(&self, other: &Self) -> bool { match self { @@ -52,6 +42,11 @@ impl PartialEq for AsciiChar { } } +#[test] +fn _ascii_char_size() { + println!("{}", std::mem::size_of::()); +} + impl PartialEq for char { fn eq(&self, other: &AsciiChar) -> bool { match other {