Let test error hide line number if it's zero (#4535)

This commit is contained in:
Leedehai 2024-07-11 10:43:16 -04:00 committed by GitHub
parent be516867c8
commit ab5cebc57c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -48,7 +48,11 @@ impl FilePos {
impl Display for FilePos {
fn fmt(&self, f: &mut Formatter) -> fmt::Result {
if self.line > 0 {
write!(f, "{}:{}", self.path.display(), self.line)
} else {
write!(f, "{}", self.path.display())
}
}
}