9dd8a56298
- Add changelog - Update publish-check recipe to match github actions - Add publish recipe - Update dependencies - Add minimimal-deps compatibility check type: release
18 lines
479 B
Rust
18 lines
479 B
Rust
use crate::common::*;
|
|
|
|
// Intermodal, or at least parts of it, might eventually be ported to
|
|
// 16-bit systems, but for now let's assume that usize is at least 32
|
|
// bits, and document that assumption with this assert.
|
|
const_assert!(std::mem::size_of::<usize>() >= std::mem::size_of::<u32>());
|
|
|
|
pub(crate) trait IntoUsize {
|
|
fn into_usize(self) -> usize;
|
|
}
|
|
|
|
impl IntoUsize for u32 {
|
|
fn into_usize(self) -> usize {
|
|
#![allow(clippy::as_conversions)]
|
|
self as usize
|
|
}
|
|
}
|