Simplify Error::custom example
This commit is contained in:
parent
e4f7d8513c
commit
7edcf6ec3b
@ -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)
|
||||
/// }
|
||||
/// }
|
||||
/// ```
|
||||
|
Loading…
x
Reference in New Issue
Block a user