Skip to content

Commit

Permalink
Make ilog64 const
Browse files Browse the repository at this point in the history
leading_zeroes and this kind of functions are const-ready since 1.34.0
We neeed rust-lang/rust#57349 to constantize
further.
  • Loading branch information
lu-zero committed Jul 20, 2019
1 parent e164358 commit 407b841
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ const DQP_Q57: &[i64; FRAME_NSUBTYPES] = &[
// This is the number of bits that would be required to represent v in two's
// complement notation with all of the leading zeros stripped.
// TODO: Mark const once leading_zeros() as a constant function stabilizes.
fn ilog64(v: i64) -> i32 {
const fn ilog64(v: i64) -> i32 {
64 - (v.leading_zeros() as i32)
}

Expand Down

0 comments on commit 407b841

Please sign in to comment.