Simplify Error::custom example

This commit is contained in:
David Tolnay 2017-01-27 14:03:40 -08:00
parent e4f7d8513c
commit 7edcf6ec3b
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

View File

@ -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)
/// }
/// }
/// ```