(_t: impl Display)
| 18 | /// Creates an error from a `T:` [`Display`]. |
| 19 | #[cfg(feature = "serde")] |
| 20 | pub fn error_from_display(_t: impl Display) -> Error { |
| 21 | #[cfg(debug_assertions)] |
| 22 | return Error(Cow::Owned(_t.to_string())); |
| 23 | #[cfg(not(debug_assertions))] |
| 24 | Error(()) |
| 25 | } |
| 26 | |
| 27 | #[cfg(debug_assertions)] |
| 28 | type ErrorImpl = Cow<'static, str>; |