Implement `Value` for `slice[T]`
Adds the ability to serialize slices of T: Value. Used to prevent having to use Vec<T> and saves allocations.
@@ -550,6 +550,12 @@ impl<T: Value> Value for Vec<T> {
}
}
+impl<T: Value> Value for &[T] {
+ fn serialize(&self, buf: &mut Vec<u8>) -> Result<(), ValueTooBig> {
+ serialize_list_or_set(self.iter(), self.len(), buf)
+ }
+}
+
fn serialize_tuple<V: Value>(
elem_iter: impl Iterator<Item = V>,
buf: &mut Vec<u8>,
