// SPDX-License-Identifier: Apache-2.0 OR MIT12use core::cmp::Ordering;34/// A line-column pair representing the start or end of a `Span`.5///6/// This type is semver exempt and not exposed by default.7#[cfg_attr(docsrs, doc(cfg(feature = "span-locations")))]8#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]9pub struct LineColumn {10/// The 1-indexed line in the source file on which the span starts or ends11/// (inclusive).12pub line: usize,13/// The 0-indexed column (in UTF-8 characters) in the source file on which14/// the span starts or ends (inclusive).15pub column: usize,16}1718impl Ord for LineColumn {19fn cmp(&self, other: &Self) -> Ordering {20self.line21.cmp(&other.line)22.then(self.column.cmp(&other.column))23}24}2526impl PartialOrd for LineColumn {27fn partial_cmp(&self, other: &Self) -> Option<Ordering> {28Some(self.cmp(other))29}30}313233