Newtype offering some utility methods for zero-based indices
In order to keep the lengths of method names reasonable, several abbreviations have been used, namely
use zero_based_index::ZBI;
let zbi = ZBI(2usize);
assert_eq!(zbi.to_len(), Some(3));
use zero_based_index::{ZBI, AsZBI};
let zbi = 2.as_zbi();
assert_eq!(zbi.to_len(), Some(3));
use zero_based_index::ZBI;
let zbi = ZBI(usize::MAX);
assert_eq!(zbi.to_len(), None);
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.