stdlib: Use if/alt expressions in std::generic_os
This commit is contained in:
parent
da0e961f61
commit
264c3b5be4
1 changed files with 4 additions and 4 deletions
|
|
@ -1,9 +1,9 @@
|
|||
fn getenv(str n) -> option::t[str] {
|
||||
auto s = os::libc::getenv(str::buf(n));
|
||||
if ((s as int) == 0) {
|
||||
ret option::none[str];
|
||||
ret if ((s as int) == 0) {
|
||||
option::none[str]
|
||||
} else {
|
||||
ret option::some[str](str::str_from_cstr(s));
|
||||
}
|
||||
option::some[str](str::str_from_cstr(s))
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue