Fix positions.
This commit is contained in:
@@ -257,16 +257,19 @@ impl fmt::Display for Position {
|
||||
|
||||
impl fmt::Debug for Position {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
#[cfg(not(feature = "no_position"))]
|
||||
if self.is_beginning_of_line() {
|
||||
write!(f, "{}", self.line)?;
|
||||
if self.is_none() {
|
||||
f.write_str("none")
|
||||
} else {
|
||||
write!(f, "{}:{}", self.line, self.pos)?;
|
||||
}
|
||||
#[cfg(feature = "no_position")]
|
||||
f.write_str("none")?;
|
||||
#[cfg(not(feature = "no_position"))]
|
||||
if self.is_beginning_of_line() {
|
||||
write!(f, "{}", self.line)
|
||||
} else {
|
||||
write!(f, "{}:{}", self.line, self.pos)
|
||||
}
|
||||
|
||||
Ok(())
|
||||
#[cfg(feature = "no_position")]
|
||||
unreachable!();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user