stdlib: Use if/alt expressions in std::generic_os

This commit is contained in:
Brian Anderson 2011-05-20 20:56:14 -04:00
parent da0e961f61
commit 264c3b5be4

View file

@ -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))
};
}