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 26, 2024
1 parent f3aa0df commit f3f0c02
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.as_view().serialize(serializer)
}
}

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

0 comments on commit f3f0c02

Please sign in to comment.