Deserializes any `Default` type, mapping JSON `null` to `T::default()`. Note** null-to-empty semantics are usually clear for container types (Map, Vec, etc). For most other data types, prefer modeling fields as ```Option ``` with #[serde(default)] instead of using this deserializer. Option preserves information about the message for the application, and default semantics for the target data typ
(deserializer: D)
| 65 | /// for the application, and default semantics for the target data type may change |
| 66 | /// over time without warning. |
| 67 | pub(crate) fn deserialize_nullish<'de, D, T>(deserializer: D) -> Result<T, D::Error> |
| 68 | where |
| 69 | D: Deserializer<'de>, |
| 70 | T: Default + Deserialize<'de>, |
| 71 | { |
| 72 | let opt = Option::deserialize(deserializer)?; |
| 73 | Ok(opt.unwrap_or_default()) |
| 74 | } |
| 75 | |
| 76 | #[cfg(test)] |
| 77 | #[allow(deprecated)] |
nothing calls this directly
no test coverage detected