Envy (#16)
Rust Build / Check (push) Successful in 32s
Rust Build / Test Suite (push) Successful in 25s
Rust Build / Rustfmt (push) Successful in 25s
Release Tagging / release (push) Successful in 1m24s
Rust Build / Clippy (push) Successful in 31s
Rust Build / build (push) Successful in 58s
Rust Build / Check (push) Successful in 32s
Rust Build / Test Suite (push) Successful in 25s
Rust Build / Rustfmt (push) Successful in 25s
Release Tagging / release (push) Successful in 1m24s
Rust Build / Clippy (push) Successful in 31s
Rust Build / build (push) Successful in 58s
Reviewed-on: phoenix/textsender-models#16
This commit was merged in pull request #16.
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
/// Take the Environment variable and delimitize it. If the value has a delimiter,
|
||||
/// extract it into some strings
|
||||
pub fn delimitize(var: &crate::envy::EnvVar) -> Result<Vec<String>, std::io::Error> {
|
||||
if var.has_delimiter {
|
||||
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",
|
||||
))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user