mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-08-14 03:35:47 -07: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:
@@ -10,6 +10,10 @@ use {Error, Result};
|
||||
/// If `byte` is not an ASCII character (i.e., greater than `0x7F`), then this
|
||||
/// function panics.
|
||||
pub fn remove(expr: Expr, byte: u8) -> Result<Expr> {
|
||||
// TODO(burntsushi): There is a bug in this routine where only `\n` is
|
||||
// handled correctly. Namely, `AnyChar` and `AnyByte` need to be translated
|
||||
// to proper character classes instead of the special `AnyCharNoNL` and
|
||||
// `AnyByteNoNL` classes.
|
||||
use syntax::Expr::*;
|
||||
assert!(byte <= 0x7F);
|
||||
let chr = byte as char;
|
||||
|
Reference in New Issue
Block a user