Skip to content

Commit cf13096

Browse files
committed
more type bound formatting
1 parent 7cd75ce commit cf13096

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

types/src/date/date.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,8 @@ T: ElasticTypeMapping<F> + ElasticDateMapping<F> {
303303
impl <F, T> Serialize for DateTime<F, T> where
304304
F: DateFormat,
305305
T: ElasticTypeMapping<F> + ElasticDateMapping<F> {
306-
fn serialize<S>(&self, serializer: &mut S) -> Result<(), S::Error> where S: Serializer
307-
{
306+
fn serialize<S>(&self, serializer: &mut S) -> Result<(), S::Error> where
307+
S: Serializer {
308308
serializer.serialize_str(&self.format())
309309
}
310310
}
@@ -313,9 +313,12 @@ T: ElasticTypeMapping<F> + ElasticDateMapping<F> {
313313
impl <F, T> Deserialize for DateTime<F, T> where
314314
F: DateFormat,
315315
T: ElasticTypeMapping<F> + ElasticDateMapping<F> {
316-
fn deserialize<D>(deserializer: &mut D) -> Result<DateTime<F, T>, D::Error> where D: Deserializer {
316+
fn deserialize<D>(deserializer: &mut D) -> Result<DateTime<F, T>, D::Error> where
317+
D: Deserializer {
317318
#[derive(Default)]
318-
struct DateTimeVisitor<F: DateFormat, T: ElasticTypeMapping<F> + ElasticDateMapping<F>> {
319+
struct DateTimeVisitor<F, T> where
320+
F: DateFormat,
321+
T: ElasticTypeMapping<F> + ElasticDateMapping<F> {
319322
phantom_f: PhantomData<F>,
320323
phantom_t: PhantomData<T>
321324
}
@@ -325,7 +328,8 @@ T: ElasticTypeMapping<F> + ElasticDateMapping<F> {
325328
T: ElasticTypeMapping<F> + ElasticDateMapping<F> {
326329
type Value = DateTime<F, T>;
327330

328-
fn visit_str<E>(&mut self, v: &str) -> Result<DateTime<F, T>, E> where E: serde::de::Error {
331+
fn visit_str<E>(&mut self, v: &str) -> Result<DateTime<F, T>, E> where
332+
E: serde::de::Error {
329333
let result = DateTime::<F, T>::parse(v);
330334
result.map_err(|err| serde::de::Error::custom(format!("{}", err)))
331335
}

0 commit comments

Comments
 (0)