1use core::cmp::Ordering;
2
3#[cfg_attr(docsrs, doc(cfg(feature = "span-locations")))]
7#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
8pub struct LineColumn {
9 pub line: usize,
12 pub column: usize,
15}
16
17impl Ord for LineColumn {
18 fn cmp(&self, other: &Self) -> Ordering {
19 self.line
20 .cmp(&other.line)
21 .then(self.column.cmp(&other.column))
22 }
23}
24
25impl PartialOrd for LineColumn {
26 fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
27 Some(self.cmp(other))
28 }
29}