Files
AstralRinth/src/util/env.rs
Geometrically 6e72be54cb R2 impl (#466)
* Add Cloudflare R2 impl

* Bump actix version

* Fix sec issues
2022-10-22 21:23:31 -07:00

11 lines
325 B
Rust

use std::str::FromStr;
pub fn parse_var<T: FromStr>(var: &'static str) -> Option<T> {
dotenvy::var(var).ok().and_then(|i| i.parse().ok())
}
pub fn parse_strings_from_var(var: &'static str) -> Option<Vec<String>> {
dotenvy::var(var)
.ok()
.and_then(|s| serde_json::from_str::<Vec<String>>(&s).ok())
}