v0.2.1
0.2.1 (2025-03-15)
Changes
-
There are now two implementations of
DeserializeforCowStr, as follows:- disabled
borrowfeature (default):CowStrallocates new strings; - enabled
borrowfeature:CowStrborrows from the input.
The
borrowfeature is disabled by default because enabling it requires
#[serde(borrow)]attributes to be applied to allCowStrfields:use serde::{Deserialize, Serialize}; #[derive(Debug, Deserialize, Serialize)] pub struct Type<'t> { #[serde(borrow)] pub name: CowStr<'t>, #[serde(borrow)] pub description: CowStr<'t>, }
With
borrowdisabled (again, by default), one does not need any additional attributes:use serde::{Deserialize, Serialize}; #[derive(Debug, Deserialize, Serialize)] pub struct Type<'t> { pub name: CowStr<'t>, pub description: CowStr<'t>, }
- disabled