Skip to content

Commit 3f02771

Browse files
chore(unescaped): better deref target
1 parent 8daeb2b commit 3f02771

File tree

1 file changed

+12
-2
lines changed
  • crates/turborepo-unescape/src

1 file changed

+12
-2
lines changed

crates/turborepo-unescape/src/lib.rs

+12-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
use std::{fmt, fmt::Display, ops::Deref};
1+
use std::{
2+
fmt::{self, Display},
3+
ops::{Deref, DerefMut},
4+
};
25

36
use biome_deserialize::{Deserializable, DeserializableValue, DeserializationDiagnostic};
47

@@ -21,12 +24,19 @@ impl AsRef<str> for UnescapedString {
2124
}
2225

2326
impl Deref for UnescapedString {
24-
type Target = str;
27+
type Target = String;
2528

2629
fn deref(&self) -> &Self::Target {
2730
&self.0
2831
}
2932
}
33+
34+
impl DerefMut for UnescapedString {
35+
fn deref_mut(&mut self) -> &mut Self::Target {
36+
&mut self.0
37+
}
38+
}
39+
3040
fn unescape_str(s: String) -> Result<String, serde_json::Error> {
3141
let wrapped_s = format!("\"{}\"", s);
3242

0 commit comments

Comments
 (0)