Switch to raw strings

This commit is contained in:
Tom Alexander
2020-04-06 20:47:17 -04:00
parent a0b032ad4b
commit 878cbf56ca

View File

@@ -329,7 +329,7 @@ pub fn template(i: &str) -> IResult<&str, Template> {
}
fn temp_string(i: &str) -> IResult<&str, &str> {
escaped(is_not("\"\\"), '\\', one_of("\"\\"))(i)
escaped(is_not(r#"\""#), '\\', one_of(r#"\""#))(i)
}
#[cfg(test)]
@@ -610,6 +610,6 @@ mod tests {
#[test]
fn test_temp_string() {
assert_eq!(temp_string("foo\\\"bar"), Ok(("", "foo\\\"bar")));
assert_eq!(temp_string(r#"foo\"bar"#), Ok(("", r#"foo\"bar"#)));
}
}