Skip to content

Commit 96bf871

Browse files
committed
Remove debug_assert from Result::unwrap_unchecked
1 parent b2ec216 commit 96bf871

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

library/core/src/result.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1481,7 +1481,6 @@ impl<T, E> Result<T, E> {
14811481
#[track_caller]
14821482
#[stable(feature = "option_result_unwrap_unchecked", since = "1.58.0")]
14831483
pub unsafe fn unwrap_unchecked(self) -> T {
1484-
debug_assert!(self.is_ok());
14851484
match self {
14861485
Ok(t) => t,
14871486
// SAFETY: the safety contract must be upheld by the caller.
@@ -1513,7 +1512,6 @@ impl<T, E> Result<T, E> {
15131512
#[track_caller]
15141513
#[stable(feature = "option_result_unwrap_unchecked", since = "1.58.0")]
15151514
pub unsafe fn unwrap_err_unchecked(self) -> E {
1516-
debug_assert!(self.is_err());
15171515
match self {
15181516
// SAFETY: the safety contract must be upheld by the caller.
15191517
Ok(_) => unsafe { hint::unreachable_unchecked() },

0 commit comments

Comments
 (0)