fn non_empty_env_var(name: &str) -> Option<String> {
    match env_var(name) {
        Ok(value) => {
            if value.is_empty() {
                None
            } else {
                Some(value)
            }
        }
        Err(_) => None,
    }
}
This is a helper function as Option<T>::filter is not yet stable (see issue #45860).
<https://github.com/rust-lang/rfcs/issues/2036> also affects the implementation of this.
rusoto/credential/src/lib.rs