Wishlist: Blocked on upstream changes
-
MSRV Rust 1.64:
- Use
workspace.packageandworkspace.dependencies. The main advantage is sharing the metadata between the related packages. The slightly simpler dependency management is a bonus.
- Use
-
MSRV Rust 1.88:
- Replace
cfg(all())andcfg(any())withcfg(true)andcfg(false)
- Replace
-
feature(adt_const_params)-
Add extra layers for serializing/deserializing. https://github.com/jonasbb/serde_with/issues/340#issuecomment-961492301
![feature(adt_const_params)] [derive(Copy, Clone, Debug, Default)] ub struct Layer<const FIELD: &'static str, T: ?Sized>(T); mpl<const FIELD: &'static str, T, U> SerializeAs<T> for Layer<FIELD, U> here U: SerializeAs<T>, T: ?Sized, U: ?Sized, fn serialize_as<S>(source: &T, serializer: S) -> Result<S::Ok, S::Error> where S: Serializer { use serde::ser::SerializeStruct; let mut ser_struct = serializer.serialize_struct("Layer", 1)?; ser_struct.serialize_field(FIELD, &ser::SerializeAsWrap::<T, U>::new(source))?; ser_struct.end() } / Can be used like this [serde_as] [derive(Serialize)] truct Data { i: i32, #[serde_as(as = r#"Layer<"extra", Layer<"foobar", Layer<"really_another_one", DisplayFromStr>>>"#)] b: bool, / or like erde_json::to_string(&Layer::<"root">(&data))https://github.com/dtolnay/monostate contains a solution to encode
&strinto a static type without requiringadt_const_params. It doesn't quite fit the above use case, since the value is not accessible as a&'static str. ButLayercould be implemented if it usesserialize_map. -
Add a macro-free version of
with_prefix!. -
Get rid of the special key name requirement for `KeyValueMap https://github.com/jonasbb/serde_with/blob/725d177fdf66583fc234ca07e2ec8df4a03c1aa4/serde_with/src/key_value_map.rs#L210-L215
-
-
feature(array_try_from_fn)https://github.com/rust-lang/rust/issues/89379- Replace the unsafe implementation of
array_from_iteratorwith something from std. https://github.com/rust-lang/rust/issues/81615 https://github.com/jonasbb/serde_with/blob/b50b611b690aeb2747030b90b7c10e921ffb2ec4/serde_with/src/utils.rs#L119-L174
- Replace the unsafe implementation of
-
Use workspace lints with separate overrides per crate: https://github.com/rust-lang/cargo/issues/13157
-
feature(core_float_math)https://github.com/rust-lang/rust/issues/137578 https://github.com/jonasbb/serde_with/blob/be794b7f89683f1adc9e508f199f0822267f2d47/serde_with/src/utils/duration.rs#L389-L399Currently, for deserializing Durations as f64 the values are rounded. The round() function is only available in
std, thus the implementations must be gated. Writing a rounding function that works well for all f64 values is also not trivial.