Skip to content
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Added `VecView`, the `!Sized` version of `Vec`.
- Added pool implementations for 64-bit architectures.
- Added `IntoIterator` implementation for `LinearMap`
- Added `StringView`, the `!Sized` version of `String`.

### Changed

Expand Down
13 changes: 11 additions & 2 deletions src/ser.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use core::hash::{BuildHasher, Hash};

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

Expand Down Expand Up @@ -113,6 +113,15 @@ where

// String containers

impl Serialize for StringView {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
{
serializer.serialize_str(&*self)
}
}

impl<const N: usize> Serialize for String<N> {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
Expand Down
Loading