serde_with v1.10.0
Added
-
Add
BorrowCow
which instructs serde to borrow data during deserialization ofCow<'_, str>
,Cow<'_, [u8]>
, orCow<'_, [u8; N]>
. (#347)
The implementation is for serde#2072 and serde#2016, about#[serde(borrow)]
not working forOption<Cow<'a, str>>
.#[serde_as] #[derive(Deserialize, Serialize)] struct Data<'a> { #[serde_as(as = "Option<[BorrowCow; 1]>")] nested: Option<[Cow<'a, str>; 1]>, }
The
#[serde(borrow)]
annotation is automatically added by the#[serde_as]
attribute.
Changed
- Bump MSRV to 1.46, since the dev-dependency bitflags requires that version now.
flattened_maybe!
no longer requires theserde_with
crate to be available with a specific name.
This allows renaming the crate or usingflattened_maybe!
through a re-export without any complications.