blob: 57ee75fdf0144892e1970297b79653ff1dfe5b44 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
/// The `Into<u64>` Rust does not provide.
/// Convert to u64 with assurance that the value is preserved.
/// Currently, `usize::BITS == 64` holds for all platforms we support.
pub(crate) trait IntoU64 {
fn as_u64(self) -> u64;
}
#[cfg(target_pointer_width = "64")]
impl IntoU64 for usize {
fn as_u64(self) -> u64 {
self as u64
}
}
|