From 407b8413123eaa847643ceea70bed6800ca83e87 Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Sat, 20 Jul 2019 12:10:26 -0400 Subject: [PATCH] Make ilog64 const leading_zeroes and this kind of functions are const-ready since 1.34.0 We neeed https://github.com/rust-lang/rust/issues/57349 to constantize further. --- src/rate.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rate.rs b/src/rate.rs index a7fce0f4f5..0116e0464f 100644 --- a/src/rate.rs +++ b/src/rate.rs @@ -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) }