Skip to content

Commit 264c3b5

Browse files
committed
stdlib: Use if/alt expressions in std::generic_os
1 parent da0e961 commit 264c3b5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/lib/generic_os.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
fn getenv(str n) -> option::t[str] {
22
auto s = os::libc::getenv(str::buf(n));
3-
if ((s as int) == 0) {
4-
ret option::none[str];
3+
ret if ((s as int) == 0) {
4+
option::none[str]
55
} else {
6-
ret option::some[str](str::str_from_cstr(s));
7-
}
6+
option::some[str](str::str_from_cstr(s))
7+
};
88
}
99

0 commit comments

Comments
 (0)