vendor some serialization tests from serde_json

This commit is contained in:
Conrad Ludgate
2025-07-17 12:07:41 +01:00
parent 44201814b9
commit e2bd8e4c61
2 changed files with 194 additions and 0 deletions

View File

@@ -32,6 +32,13 @@ impl ValueEncoder for &str {
}
}
impl ValueEncoder for String {
#[inline]
fn encode(self, v: ValueSer<'_>) {
self.as_str().encode(v);
}
}
impl ValueEncoder for fmt::Arguments<'_> {
#[inline]
fn encode(self, v: ValueSer<'_>) {
@@ -102,6 +109,13 @@ impl KeyEncoder for &str {
}
}
impl KeyEncoder for String {
#[inline]
fn write_key<'a>(self, obj: &'a mut ObjectSer) -> ValueSer<'a> {
self.as_str().write_key(obj)
}
}
impl KeyEncoder for fmt::Arguments<'_> {
#[inline]
fn write_key<'a>(self, obj: &'a mut ObjectSer) -> ValueSer<'a> {