Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
redox-os
ion
Commits
5905080b
Commit
5905080b
authored
Jun 13, 2020
by
storyfeet
Browse files
now uses unwrap_or_default()
parent
ad31aa99
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/shell/variables.rs
View file @
5905080b
...
...
@@ -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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment