From 101547dbf49fcf17867ffb647557d9bc3061d04b Mon Sep 17 00:00:00 2001 From: phoenix Date: Fri, 10 Oct 2025 14:25:13 -0400 Subject: [PATCH] Code formatting --- src/lib.rs | 2 +- src/utility.rs | 10 ++++++++-- tests/test.rs | 14 ++++++++++++-- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index ab8f471..bc3dd1d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -7,7 +7,7 @@ pub struct EnvVar { pub key: String, pub value: String, pub has_delimiter: bool, - pub delimiter: char + pub delimiter: char, } pub fn init_envvar(key: &str, value: &str) -> EnvVar { diff --git a/src/utility.rs b/src/utility.rs index ebc966d..11b5476 100644 --- a/src/utility.rs +++ b/src/utility.rs @@ -2,8 +2,14 @@ /// extract it into some strings pub fn delimitize(var: &crate::EnvVar) -> Result, std::io::Error> { if var.has_delimiter { - Ok(var.value.split(var.delimiter).map(|c| c.parse::().unwrap()).collect()) + Ok(var + .value + .split(var.delimiter) + .map(|c| c.parse::().unwrap()) + .collect()) } else { - Err(std::io::Error::other("Environment variable does not have a delimiter")) + Err(std::io::Error::other( + "Environment variable does not have a delimiter", + )) } } diff --git a/tests/test.rs b/tests/test.rs index 20a9468..59bc259 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -116,11 +116,21 @@ mod tests { result ); - assert_eq!(result.has_delimiter, true, "The {} variable has an issue finding the delimiter", result.key); + assert_eq!( + result.has_delimiter, true, + "The {} variable has an issue finding the delimiter", + result.key + ); match icarus_envy::utility::delimitize(&result) { Ok(allowed_origins) => { - assert_eq!(allowed_origins.len(), 2, "The amount of allowed origins does not match. {} {}", allowed_origins.len(), 2) + assert_eq!( + allowed_origins.len(), + 2, + "The amount of allowed origins does not match. {} {}", + allowed_origins.len(), + 2 + ) } Err(err) => { assert!(false, "Error: {:?}", err)