Files
schedtxt_models/src/envy/utility.rs
T
phoenix 1340440fec
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
Envy (#16)
Reviewed-on: phoenix/textsender-models#16
2026-05-31 15:45:17 -04:00

16 lines
501 B
Rust

/// 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",
))
}
}