mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-25 01:07:56 +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
|
||||
/// {
|
||||
/// let s = try!(String::deserialize(deserializer));
|
||||
/// match s.parse() {
|
||||
/// Ok(s) => Ok(s),
|
||||
/// Err(err) => Err(Error::custom(err)),
|
||||
/// }
|
||||
/// s.parse().map_err(Error::custom)
|
||||
/// }
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
Reference in New Issue
Block a user