Skip to content

Commit d1c27ba

Browse files
committed
Revert "Make option::get return the option contents by reference" due to memory corruption
This reverts commit fc0bf12.
1 parent fc0bf12 commit d1c27ba

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/lib/option.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
tag t<@T> { none; some(T); }
44

5-
fn get<@T>(opt: t<T>) -> &T {
6-
alt opt { some(x) { ret x; } none. { fail "option none"; } }
5+
fn get<@T>(opt: t<T>) -> T {
6+
alt opt { some(x) { x } none. { fail "option none" } }
77
}
88

99
fn map<@T, @U>(f: block(T) -> U, opt: t<T>) -> t<U> {

0 commit comments

Comments
 (0)