diff --git a/influxdb/src/query/line_proto_term.rs b/influxdb/src/query/line_proto_term.rs index 4d35c53..2ba8b3c 100644 --- a/influxdb/src/query/line_proto_term.rs +++ b/influxdb/src/query/line_proto_term.rs @@ -62,7 +62,7 @@ impl LineProtoTerm<'_> { Float(v) => format!(r#""{}""#, v.to_string()), SignedInteger(v) => format!(r#""{}""#, v), UnsignedInteger(v) => format!(r#""{}""#, v), - Text(v) => format!(r#""{}""#, Self::escape_any(v, &*SLASHES)), + Text(v) => Self::escape_any(v, &*SLASHES), } } @@ -80,19 +80,19 @@ mod test { fn test() { assert_eq!( TagValue(&Type::Text("this is my special string".into())).escape(), - r#""this\ is\ my\ special\ string""# + r#"this\ is\ my\ special\ string"# ); assert_eq!( TagValue(&Type::Text("a tag w=i th == tons of escapes".into())).escape(), - r#""a\ tag\ w\=i\ th\ \=\=\ tons\ of\ escapes""# + r#"a\ tag\ w\=i\ th\ \=\=\ tons\ of\ escapes"# ); assert_eq!( TagValue(&Type::Text("no_escapes".into())).escape(), - r#""no_escapes""# + r#"no_escapes"# ); assert_eq!( TagValue(&Type::Text("some,commas,here".into())).escape(), - r#""some\,commas\,here""# + r#"some\,commas\,here"# ); assert_eq!(Measurement(r#"wea", ther"#).escape(), r#"wea"\,\ ther"#); @@ -120,6 +120,6 @@ mod test { fn test_empty_tag_value() { // InfluxDB doesn't support empty tag values. But that's a job // of a calling site to validate an entire write request. - assert_eq!(TagValue(&Type::Text("".into())).escape(), r#""""#); + assert_eq!(TagValue(&Type::Text("".into())).escape(), r#""#); } } diff --git a/influxdb/src/query/write_query.rs b/influxdb/src/query/write_query.rs index 831df20..07a9d39 100644 --- a/influxdb/src/query/write_query.rs +++ b/influxdb/src/query/write_query.rs @@ -282,7 +282,7 @@ mod tests { assert!(query.is_ok(), "Query was empty"); assert_eq!( query.unwrap(), - r#"weather,location="us-midwest",season="summer" temperature=82i 11"# + r#"weather,location=us-midwest,season=summer temperature=82i 11"# ); } @@ -307,7 +307,7 @@ mod tests { .add_field("\"temp=era,t ure\"", r#"too"\\hot"#) .add_field("float", 82.0) .add_tag("location", "us-midwest") - .add_tag("loc, =\"ation", r#"us, "mid=west""#) + .add_tag("loc, =\"ation", r#"us, "mid=west"#) .build(); assert!(query.is_ok(), "Query was empty"); @@ -315,7 +315,7 @@ mod tests { #[allow(clippy::print_literal)] assert_eq!( query_res, - r#"wea\,\ ther=,location="us-midwest",loc\,\ \="ation="us\,\ \"mid\=west\"" temperature=82i,"temp\=era\,t\ ure"="too\"\\\\hot",float=82 11"# + r#"wea\,\ ther=,location=us-midwest,loc\,\ \="ation=us\,\ \"mid\=west temperature=82i,"temp\=era\,t\ ure"="too\"\\\\hot",float=82 11"# ); } }