mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-06-12 21:21:02 +00:00
Simplify Error::custom example
This commit is contained in:
+1
-4
@@ -150,10 +150,7 @@ pub trait Error: Sized + error::Error {
|
|||||||
/// where D: Deserializer
|
/// where D: Deserializer
|
||||||
/// {
|
/// {
|
||||||
/// let s = try!(String::deserialize(deserializer));
|
/// let s = try!(String::deserialize(deserializer));
|
||||||
/// match s.parse() {
|
/// s.parse().map_err(Error::custom)
|
||||||
/// Ok(s) => Ok(s),
|
|
||||||
/// Err(err) => Err(Error::custom(err)),
|
|
||||||
/// }
|
|
||||||
/// }
|
/// }
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
|||||||
Reference in New Issue
Block a user