Skip to content

Commit

Permalink
Clean up const-hack from rust-lang#61635
Browse files Browse the repository at this point in the history
  • Loading branch information
jumbatm committed Dec 27, 2019
1 parent 8c49486 commit 282635f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/libcore/num/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2037,7 +2037,11 @@ $EndFeature, "
#[rustc_const_unstable(feature = "const_int_sign", issue = "53718")]
#[inline]
pub const fn signum(self) -> Self {
(self > 0) as Self - (self < 0) as Self
match self {
n if n > 0 => 1,
0 => 0,
_ => -1,
}
}
}

Expand Down

0 comments on commit 282635f

Please sign in to comment.