summaryrefslogtreecommitdiff
path: root/src/error.rs
diff options
context:
space:
mode:
authorSam Scott <sam.scott89@gmail.com>2017-11-09 16:28:07 +0000
committerSam Scott <sam.scott89@gmail.com>2017-11-09 16:40:24 +0000
commit61ccfb416e553301d9db604d0986d184796b0280 (patch)
tree767bc2cfe83e439f5cd973c8088aa7de68203fb9 /src/error.rs
parentd74354b1eaccfb6ea264fca81f3dd936afdff44f (diff)
Let rustfmt do its thing.
Diffstat (limited to 'src/error.rs')
-rw-r--r--src/error.rs14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/error.rs b/src/error.rs
index 555bf5e..aecc2d0 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -33,20 +33,24 @@ impl Error {
/// Generate error to show top-level type cannot be deserialized.
pub fn top_level(object: &'static str) -> Self {
ErrorKind::Custom(format!("cannot deserialize {} at the top level.\
- Try deserializing into a struct.", object)).into()
+ Try deserializing into a struct.",
+ object))
+ .into()
}
/// Generate a parsing error message with position.
pub fn parse_err<T>(msg: T, position: usize) -> Self
- where T: Display {
+ where T: Display,
+ {
ErrorKind::Parse(msg.to_string(), position).into()
}
}
impl de::Error for Error {
- fn custom<T>(msg: T) -> Self
- where T: Display {
- ErrorKind::Custom(msg.to_string()).into()
+ fn custom<T>(msg: T) -> Self
+ where T: Display,
+ {
+ ErrorKind::Custom(msg.to_string()).into()
}
}