Code formatting
Some checks failed
Release Tagging / release (pull_request) Successful in 32s
Rust Build / Check (pull_request) Successful in 31s
Rust Build / Test Suite (pull_request) Successful in 32s
Rust Build / Rustfmt (pull_request) Successful in 32s
Rust Build / Clippy (pull_request) Failing after 33s
Rust Build / build (pull_request) Successful in 35s
Some checks failed
Release Tagging / release (pull_request) Successful in 32s
Rust Build / Check (pull_request) Successful in 31s
Rust Build / Test Suite (pull_request) Successful in 32s
Rust Build / Rustfmt (pull_request) Successful in 32s
Rust Build / Clippy (pull_request) Failing after 33s
Rust Build / build (pull_request) Successful in 35s
This commit is contained in:
@@ -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 {
|
||||
|
@@ -2,8 +2,14 @@
|
||||
/// extract it into some strings
|
||||
pub fn delimitize(var: &crate::EnvVar) -> Result<Vec<String>, std::io::Error> {
|
||||
if var.has_delimiter {
|
||||
Ok(var.value.split(var.delimiter).map(|c| c.parse::<String>().unwrap()).collect())
|
||||
Ok(var
|
||||
.value
|
||||
.split(var.delimiter)
|
||||
.map(|c| c.parse::<String>().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",
|
||||
))
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user