intermodal/src/into_u64.rs
Casey Rodarmor 9f83661374
Configure clippy and lint on push
Enable as many lints as I can stand. I'll definitely add more exceptions as
`clippy::pedantic` and `clippy::restriction` wear me down.

type: testing
2020-04-07 18:55:45 -07:00

17 lines
409 B
Rust

use crate::common::*;
// Systems with pointers larger than 64 bits may eventually exist, but
// for now let's assume that usize is at most 32 bits, and document that
// assumption with this assert.
const_assert!(std::mem::size_of::<usize>() <= std::mem::size_of::<u64>());
pub(crate) trait IntoU64 {
fn into_u64(self) -> u64;
}
impl IntoU64 for usize {
fn into_u64(self) -> u64 {
self as u64
}
}