From 878cbf56ca93c49085f2ace82893225f0b43c7b1 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Mon, 6 Apr 2020 20:47:17 -0400 Subject: [PATCH] Switch to raw strings --- src/parser/parser.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/parser/parser.rs b/src/parser/parser.rs index 54db026..6c6d4a7 100644 --- a/src/parser/parser.rs +++ b/src/parser/parser.rs @@ -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"#))); } }