From bccdce1a3ac0dc0646f4ffa9bc0a09ea19ae58a5 Mon Sep 17 00:00:00 2001 From: Sam Scott Date: Sun, 12 Mar 2017 14:44:44 -0400 Subject: Run rustfmt on code. --- src/ser/key.rs | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) (limited to 'src/ser/key.rs') diff --git a/src/ser/key.rs b/src/ser/key.rs index 5b2ccdd..10f1fff 100644 --- a/src/ser/key.rs +++ b/src/ser/key.rs @@ -1,7 +1,7 @@ -use ser::{Error}; -use serde::ser::{SerializeSeq, SerializeStruct}; +use ser::Error; use ser::part::Sink; use serde::Serialize; +use serde::ser::{SerializeSeq, SerializeStruct}; use std::borrow::Cow; use std::ops::Deref; @@ -35,7 +35,7 @@ pub struct KeySink { } impl KeySink - where End: for<'key> FnOnce(Key<'key>) -> Result + where End: for<'key> FnOnce(Key<'key>) -> Result, { pub fn new(end: End) -> Self { KeySink { end: end } @@ -43,12 +43,9 @@ impl KeySink } impl Sink for KeySink - where End: for<'key> FnOnce(Key<'key>) -> Result + where End: for<'key> FnOnce(Key<'key>) -> Result, { - - fn serialize_static_str(self, - value: &'static str) - -> Result { + fn serialize_static_str(self, value: &'static str) -> Result { (self.end)(Key::Static(value)) } @@ -76,15 +73,15 @@ impl Sink for KeySink } impl SerializeStruct for KeySink -where End: for<'key> FnOnce(Key<'key>) -> Result + where End: for<'key> FnOnce(Key<'key>) -> Result, { type Ok = Ok; type Error = Error; fn serialize_field(&mut self, - _key: &'static str, - _value: &T) - -> Result<(), Error> { + _key: &'static str, + _value: &T) + -> Result<(), Error> { Err(self.unsupported()) } @@ -94,14 +91,14 @@ where End: for<'key> FnOnce(Key<'key>) -> Result } impl SerializeSeq for KeySink -where End: for<'key> FnOnce(Key<'key>) -> Result + where End: for<'key> FnOnce(Key<'key>) -> Result, { type Ok = Ok; type Error = Error; fn serialize_element(&mut self, - _value: &T) - -> Result<(), Error> { + _value: &T) + -> Result<(), Error> { Err(self.unsupported()) } @@ -109,6 +106,3 @@ where End: for<'key> FnOnce(Key<'key>) -> Result Err(self.unsupported()) } } - - - -- cgit v1.2.3