1
0
mirror of https://github.com/BurntSushi/ripgrep.git synced 2025-06-25 14:22:54 +02:00

Improve the "bad literal" error message.

Incidentally, this was done by using the Debug impl for `char` instead
of the Display impl. Cute.

Fixes #5.
This commit is contained in:
Andrew Gallant
2016-09-16 18:12:00 -04:00
parent e9ec52b7f9
commit d22a3ca3e5
2 changed files with 5 additions and 1 deletions

View File

@ -62,7 +62,7 @@ impl fmt::Display for Error {
match *self {
Error::Regex(ref err) => err.fmt(f),
Error::LiteralNotAllowed(chr) => {
write!(f, "Literal '{}' not allowed.", chr)
write!(f, "Literal {:?} not allowed.", chr)
}
Error::__Nonexhaustive => unreachable!(),
}