ra_syntax: remove message() method and use only Display trait in SyntaxError as per matklad

This commit is contained in:
Veetaha 2020-02-17 23:13:38 +02:00
parent e05eb631d4
commit cd8e56c580
2 changed files with 1 additions and 4 deletions

View file

@ -115,7 +115,7 @@ impl Parse<SourceFile> {
pub fn debug_dump(&self) -> String {
let mut buf = format!("{:#?}", self.tree().syntax());
for err in self.errors.iter() {
writeln!(buf, "error {:?}: {}", err.range(), err.message()).unwrap();
writeln!(buf, "error {:?}: {}", err.range(), err).unwrap();
}
buf
}

View file

@ -27,9 +27,6 @@ impl SyntaxError {
Self(message.into(), TextRange::offset_len(offset, 0.into()))
}
pub fn message(&self) -> &str {
&self.0
}
pub fn range(&self) -> TextRange {
self.1
}