ron_reboot/
location.rs

1use std::fmt::{Display, Formatter};
2
3#[cfg(test)]
4use crate::utf8_parser::test_util::TestMockNew;
5
6#[derive(Clone, Copy, Debug, Eq, Ord, PartialEq, PartialOrd)]
7pub struct Location {
8    pub line: u32,
9    /// UTF-8 column
10    pub column: u32,
11}
12
13impl Display for Location {
14    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
15        write!(f, "{}:{}", self.line, self.column)
16    }
17}
18
19#[cfg(test)]
20impl TestMockNew for Location {
21    fn new_mocked() -> Self {
22        Location { line: 1, column: 1 }
23    }
24}