Skip to content

Commit 6c258da

Browse files
committed
Remove custom Serde helper type
1 parent 5c443e6 commit 6c258da

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

src/value.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ impl Serialize for Value<'_> {
332332
map.end()
333333
}
334334
Value::Literal(v) => s.collect_str(v),
335-
Value::Owned(v) => Bytes(v).serialize(s),
335+
Value::Owned(v) => s.serialize_bytes(v),
336336
}
337337
}
338338
}
@@ -460,14 +460,3 @@ impl From<i64> for Value<'_> {
460460
Value::Number(Number::Dec(value))
461461
}
462462
}
463-
464-
/// Helper type to enforce that serialize_bytes() is used in serialization.
465-
#[cfg(feature = "serde")]
466-
pub(crate) struct Bytes<'a>(pub &'a [u8]);
467-
468-
#[cfg(feature = "serde")]
469-
impl Serialize for Bytes<'_> {
470-
fn serialize<S: Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
471-
s.serialize_bytes(self.0)
472-
}
473-
}

0 commit comments

Comments
 (0)