Function itconfig::get_vec_env_or_default [−][src]
pub fn get_vec_env_or_default<T, D>(
env_name: &str,
sep: &str,
default: Vec<D>
) -> Vec<T> where
T: FromEnvString,
D: ToEnvString,
Expand description
This function is similar as get_vec_env_or_panic
, but you can pass default value for
environment variable with ToEnvString
trait.
Panics
Application will panic if cannot parse variable to expected type
Example
use std::env; fn main () { let result: Vec<bool> = get_vec_env_or_default("TESTING", ",", vec!["true"]); assert_eq!(result, vec![true]); }