Mercurial > crates > systemd-socket
comparison src/lib.rs @ 9:4fb70ca820a6
Upgrade serde_str_helpers
This upgrade supports direct conversion to `String`, which looks nicer.
| author | Martin Habovstiak <martin.habovstiak@gmail.com> |
|---|---|
| date | Sat, 28 Nov 2020 15:47:47 +0100 |
| parents | 9731ff589d9c |
| children | 13e2a5545167 |
comparison
equal
deleted
inserted
replaced
| 8:372afb9a700f | 9:4fb70ca820a6 |
|---|---|
| 349 #[cfg(feature = "serde")] | 349 #[cfg(feature = "serde")] |
| 350 impl<'a> TryFrom<serde_str_helpers::DeserBorrowStr<'a>> for SocketAddr { | 350 impl<'a> TryFrom<serde_str_helpers::DeserBorrowStr<'a>> for SocketAddr { |
| 351 type Error = ParseError; | 351 type Error = ParseError; |
| 352 | 352 |
| 353 fn try_from(s: serde_str_helpers::DeserBorrowStr<'a>) -> Result<Self, Self::Error> { | 353 fn try_from(s: serde_str_helpers::DeserBorrowStr<'a>) -> Result<Self, Self::Error> { |
| 354 SocketAddr::try_from_generic(std::borrow::Cow::from(s)) | 354 SocketAddr::try_from_generic(s) |
| 355 } | 355 } |
| 356 } | 356 } |
| 357 | 357 |
| 358 #[cfg(feature = "parse_arg")] | 358 #[cfg(feature = "parse_arg")] |
| 359 impl parse_arg::ParseArg for SocketAddr { | 359 impl parse_arg::ParseArg for SocketAddr { |
