We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 07d3301 commit fad8347Copy full SHA for fad8347
1 file changed
src/macros.rs
@@ -97,14 +97,7 @@ pub(crate) use dbg;
97
#[allow(unused_macros)]
98
macro_rules! hermit_var {
99
($name:expr) => {
100
- match $crate::env::var($name) {
101
- ::core::option::Option::Some(val) => {
102
- ::core::option::Option::Some(::alloc::borrow::Cow::from(val))
103
- }
104
- ::core::option::Option::None => {
105
- ::core::option_env!($name).map(::alloc::borrow::Cow::Borrowed)
106
107
+ $crate::env::var($name).map(|s| s.as_str())
108
};
109
}
110
@@ -118,7 +111,6 @@ pub(crate) use hermit_var;
118
111
macro_rules! hermit_var_or {
119
112
($name:expr, $default:expr) => {
120
113
$crate::macros::hermit_var!($name)
121
- .as_deref()
122
114
.unwrap_or($default)
123
115
124
116
0 commit comments