Skip to content

Commit 282635f

Browse files
committed
Clean up const-hack from #61635
1 parent 8c49486 commit 282635f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/libcore/num/mod.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -2037,7 +2037,11 @@ $EndFeature, "
20372037
#[rustc_const_unstable(feature = "const_int_sign", issue = "53718")]
20382038
#[inline]
20392039
pub const fn signum(self) -> Self {
2040-
(self > 0) as Self - (self < 0) as Self
2040+
match self {
2041+
n if n > 0 => 1,
2042+
0 => 0,
2043+
_ => -1,
2044+
}
20412045
}
20422046
}
20432047

0 commit comments

Comments
 (0)