PluralKit/lib/pk_core/src/util.rs
2022-07-10 01:15:03 -04:00

7 lines
217 B
Rust

/// get_env gets an env variable as Option<String instead of Result<String>.
pub fn get_env(key: &str) -> Option<String> {
match std::env::var(key) {
Ok(val) => { Some(val) }
Err(_) => None
}
}