From 0307c0254b44621616b93034432d32e508325806 Mon Sep 17 00:00:00 2001 From: kdeng00 Date: Mon, 8 Apr 2024 12:36:40 -0400 Subject: [PATCH] Updated utilities module --- src/utilities/checks.rs | 6 +----- src/utilities/conversions.rs | 15 +++++++-------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/utilities/checks.rs b/src/utilities/checks.rs index ace1ca7..464ca6d 100644 --- a/src/utilities/checks.rs +++ b/src/utilities/checks.rs @@ -1,15 +1,12 @@ use serde::{Deserialize, Serialize}; -// mod utilities { - #[derive(Debug, Deserialize, Serialize)] pub struct Checks { } impl Checks { - // TODO: Implement pub fn is_number(val: &String) -> bool { - return false; + return val.is_numeric(); } // TODO: Implement @@ -24,4 +21,3 @@ impl Checks { return String::from(""); } } -// } diff --git a/src/utilities/conversions.rs b/src/utilities/conversions.rs index 822ac12..ed90b8d 100644 --- a/src/utilities/conversions.rs +++ b/src/utilities/conversions.rs @@ -1,23 +1,22 @@ use serde::{Deserialize, Serialize}; -// mod utilities { #[derive(Debug, Deserialize, Serialize)] pub struct Conversions { } impl Conversions { - // TODO: Implement - pub fn to_lower_char(val: &mut String) { + pub fn to_lower_char(val: &mut char) { + if val.is_alphabetic() { + val = val.to_lowercase(); + } } - // TODO: Implement pub fn initialize_values(&self) { } - // TODO: Implement - pub fn print_value(&self, val: i32) { + pub fn print_value(&self, val: T) { + println!("Going to print value"); + println!("{}", val); } } - -// } \ No newline at end of file