From c3cad5dfdda9be161661ca84ddc4898bb4e9a223 Mon Sep 17 00:00:00 2001 From: pedrocarlo Date: Fri, 7 Feb 2025 00:07:51 -0300 Subject: [PATCH] corrected to use newly created as_str function to convert to string slice --- core/json/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/json/mod.rs b/core/json/mod.rs index 5d156e6d7..bca1eb5de 100644 --- a/core/json/mod.rs +++ b/core/json/mod.rs @@ -15,7 +15,6 @@ pub use crate::json::ser::to_string; use crate::types::{OwnedValue, Text, TextSubtype}; use indexmap::IndexMap; use jsonb::Error as JsonbError; -use rustix::path::Arg; use ser::to_string_pretty; use serde::{Deserialize, Serialize}; @@ -687,7 +686,8 @@ pub fn json_quote(value: &OwnedValue) -> crate::Result { let mut escaped_value = String::with_capacity(t.value.len() + 4); escaped_value.push('"'); - for c in t.value.to_string_lossy().chars() { + + for c in t.as_str().chars() { match c { '"' | '\\' | '\n' | '\r' | '\t' | '\u{0008}' | '\u{000c}' => { escaped_value.push('\\');