aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax
diff options
context:
space:
mode:
authorVeetaha <[email protected]>2020-02-17 21:13:38 +0000
committerVeetaha <[email protected]>2020-02-17 21:13:38 +0000
commitcd8e56c580fd8e79eccd55790a23a4b554bbe161 (patch)
treeb071a5de3696740947e9b1bf63511445abd3cc04 /crates/ra_syntax
parente05eb631d41a7743a16daa982edf1001a294783a (diff)
ra_syntax: remove message() method and use only Display trait in SyntaxError as per matklad
Diffstat (limited to 'crates/ra_syntax')
-rw-r--r--crates/ra_syntax/src/lib.rs2
-rw-r--r--crates/ra_syntax/src/syntax_error.rs3
2 files changed, 1 insertions, 4 deletions
diff --git a/crates/ra_syntax/src/lib.rs b/crates/ra_syntax/src/lib.rs
index cc02c4be5..e3f74da6d 100644
--- a/crates/ra_syntax/src/lib.rs
+++ b/crates/ra_syntax/src/lib.rs
@@ -115,7 +115,7 @@ impl Parse<SourceFile> {
115 pub fn debug_dump(&self) -> String { 115 pub fn debug_dump(&self) -> String {
116 let mut buf = format!("{:#?}", self.tree().syntax()); 116 let mut buf = format!("{:#?}", self.tree().syntax());
117 for err in self.errors.iter() { 117 for err in self.errors.iter() {
118 writeln!(buf, "error {:?}: {}", err.range(), err.message()).unwrap(); 118 writeln!(buf, "error {:?}: {}", err.range(), err).unwrap();
119 } 119 }
120 buf 120 buf
121 } 121 }
diff --git a/crates/ra_syntax/src/syntax_error.rs b/crates/ra_syntax/src/syntax_error.rs
index 135301bf6..54acf7847 100644
--- a/crates/ra_syntax/src/syntax_error.rs
+++ b/crates/ra_syntax/src/syntax_error.rs
@@ -27,9 +27,6 @@ impl SyntaxError {
27 Self(message.into(), TextRange::offset_len(offset, 0.into())) 27 Self(message.into(), TextRange::offset_len(offset, 0.into()))
28 } 28 }
29 29
30 pub fn message(&self) -> &str {
31 &self.0
32 }
33 pub fn range(&self) -> TextRange { 30 pub fn range(&self) -> TextRange {
34 self.1 31 self.1
35 } 32 }