Commit 5905080b authored by storyfeet's avatar storyfeet
Browse files

now uses unwrap_or_default()

parent ad31aa99
......@@ -196,10 +196,7 @@ impl Variables {
.map_err(|cause| Error::InvalidHex(variable.into(), cause))?;
Ok((c as char).to_string().into())
}
Some(("env", variable)) => match env::var(variable) {
Ok(v) => Ok(v.into()),
Err(_) => Ok("".into()),
},
Some(("env", variable)) => Ok(env::var(variable).unwrap_or_default().into()),
Some(("super", _)) | Some(("global", _)) | None => {
// Otherwise, it's just a simple variable name.
match self.get(name) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment