1
Fork 0

Revert "Make option::get return the option contents by reference" due to memory corruption

This reverts commit fc0bf12516.
This commit is contained in:
Patrick Walton 2011-09-15 12:52:09 -07:00
parent fc0bf12516
commit d1c27ba9e0

View file

@ -2,8 +2,8 @@
tag t<@T> { none; some(T); }
fn get<@T>(opt: t<T>) -> &T {
alt opt { some(x) { ret x; } none. { fail "option none"; } }
fn get<@T>(opt: t<T>) -> T {
alt opt { some(x) { x } none. { fail "option none" } }
}
fn map<@T, @U>(f: block(T) -> U, opt: t<T>) -> t<U> {