Skip to content

Commit bb88f77

Browse files
olsonjefferybrson
authored andcommitted
core: doc/err feedback tweeks for result::unwrap
1 parent a40f550 commit bb88f77

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/libcore/result.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,13 +218,11 @@ fn iter2<S,T,U:copy>(ss: [S], ts: [T],
218218

219219
#[doc="
220220
Unwraps a result, assuming it is an `ok(T)`
221-
222-
This operation is unsafe.
223221
"]
224222
fn unwrap<T, U>(-res: result<T, U>) -> T unsafe {
225223
let addr = alt res {
226224
ok(x) { ptr::addr_of(x) }
227-
err(_) { fail "option none" }
225+
err(_) { fail "error result" }
228226
};
229227
let liberated_value = unsafe::reinterpret_cast(*addr);
230228
unsafe::forget(res);

0 commit comments

Comments
 (0)