just/src/ordinal.rs

11 lines
196 B
Rust
Raw Normal View History

pub(crate) trait Ordinal {
2019-04-19 02:17:43 -07:00
/// Convert an index starting at 0 to an ordinal starting at 1
fn ordinal(self) -> Self;
}
impl Ordinal for usize {
fn ordinal(self) -> Self {
self + 1
}
}