Skip to content

Commit

Permalink
VecView: Implement serialize
Browse files Browse the repository at this point in the history
  • Loading branch information
sosthene-nitrokey committed Feb 8, 2024
1 parent c593fa5 commit 62c5823
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/ser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use core::hash::{BuildHasher, Hash};

use crate::{
binary_heap::Kind as BinaryHeapKind, BinaryHeap, Deque, IndexMap, IndexSet, LinearMap, String,
Vec,
Vec, VecView,
};
use serde::ser::{Serialize, SerializeMap, SerializeSeq, Serializer};

Expand Down Expand Up @@ -43,6 +43,18 @@ where
}

impl<T, const N: usize> Serialize for Vec<T, N>
where
T: Serialize,
{
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
{
self.view().serialize(serializer)
}
}

impl<T> Serialize for VecView<T>
where
T: Serialize,
{
Expand Down

0 comments on commit 62c5823

Please sign in to comment.