summaryrefslogtreecommitdiff
path: root/src/parse/parser.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-11-15 16:59:49 +0100
committerLaurenz <laurmaedje@gmail.com>2021-11-15 17:06:43 +0100
commit63c274e7f6aa3a8c3f43abb91935ec924a186f73 (patch)
tree193777ff773c6b547c6ef828ddf9750694fae7bc /src/parse/parser.rs
parent8a38899c98b4f9829b2d1f21c8fee66d254d20c6 (diff)
Make clippy happier and remove `Str`
Diffstat (limited to 'src/parse/parser.rs')
-rw-r--r--src/parse/parser.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/parse/parser.rs b/src/parse/parser.rs
index 1c4c2a5c..6598b1f2 100644
--- a/src/parse/parser.rs
+++ b/src/parse/parser.rs
@@ -242,7 +242,7 @@ impl<'s> Parser<'s> {
self.eat();
rescan = false;
} else if required {
- self.push_error(format!("expected {}", end));
+ self.push_error(format_eco!("expected {}", end));
}
}
@@ -327,8 +327,8 @@ impl Parser<'_> {
pub fn unexpected(&mut self) {
match self.peek() {
Some(found) => {
- let msg = format!("unexpected {}", found);
- let error = NodeKind::Error(ErrorPos::Full, msg.into());
+ let msg = format_eco!("unexpected {}", found);
+ let error = NodeKind::Error(ErrorPos::Full, msg);
self.perform(error, Self::eat);
}
None => self.push_error("unexpected end of file"),
@@ -339,8 +339,8 @@ impl Parser<'_> {
pub fn expected(&mut self, thing: &str) {
match self.peek() {
Some(found) => {
- let msg = format!("expected {}, found {}", thing, found);
- let error = NodeKind::Error(ErrorPos::Full, msg.into());
+ let msg = format_eco!("expected {}, found {}", thing, found);
+ let error = NodeKind::Error(ErrorPos::Full, msg);
self.perform(error, Self::eat);
}
None => self.expected_at(thing),
@@ -400,8 +400,8 @@ impl Marker {
/// Insert an error message that `what` was expected at the marker position.
pub fn expected(self, p: &mut Parser, what: &str) {
- let msg = format!("expected {}", what);
- let error = NodeKind::Error(ErrorPos::Full, msg.into());
+ let msg = format_eco!("expected {}", what);
+ let error = NodeKind::Error(ErrorPos::Full, msg);
p.children.insert(self.0, GreenData::new(error, 0).into());
}