#![deny(missing_docs, rust_2018_idioms, unsafe_code)]
pub type Id = [u8; 4];
pub const SENTINEL: Id = [0u8; 4];
pub mod range {
use std::{convert::TryInto, ops::Range};
use crate::file;
pub fn into_usize(Range { start, end }: Range<file::Offset>) -> Option<Range<usize>> {
let start = start.try_into().ok()?;
let end = end.try_into().ok()?;
Some(Range { start, end })
}
pub fn into_usize_or_panic(range: Range<file::Offset>) -> Range<usize> {
into_usize(range).expect("memory maps can't be created if files are too large")
}
}
pub mod file;