Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aienux/blob/main/vendor/proc-macro2/src/location.rs # aienux Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aienux / vendor / proc-macro2 / src / location.rs` 29 lines ยท 871 bytes Raw Blame History 1 use core::cmp::Ordering; 2 3 /// A line-column pair representing the start or end of a `Span`. 4 /// 5 /// This type is semver exempt and not exposed by default. 6 #[cfg_attr(docsrs, doc(cfg(feature = "span-locations")))] 7 #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] 8 pub struct LineColumn { 9 /// The 1-indexed line in the source file on which the span starts or ends 10 /// (inclusive). 11 pub line: usize, 12 /// The 0-indexed column (in UTF-8 characters) in the source file on which 13 /// the span starts or ends (inclusive). 14 pub column: usize, 15 } 16 17 impl 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 25 impl PartialOrd for LineColumn { 26 fn partial_cmp(&self, other: &Self) -> Option { 27 Some(self.cmp(other)) 28 } 29 }