mirror of
https://gitlab.redox-os.org/redox-os/redox.git
synced 2026-11-06 04:27:45 +08:00
cookbook: Trim env before parsing
This commit is contained in:
parent
0ecd42af89
commit
48e589440f
@ -223,7 +223,7 @@ pub fn init_config() {
|
||||
#[allow(unused_variables)]
|
||||
fn extract_env<T: FromStr>(key: &str, default: T) -> T {
|
||||
#[cfg(not(test))]
|
||||
if let Ok(e) = std::env::var(key) {
|
||||
if let Ok(e) = std::env::var(key.trim()) {
|
||||
str::parse(&e).unwrap_or(default)
|
||||
} else {
|
||||
default
|
||||
|
||||
Loading…
Reference in New Issue
Block a user