From 8c3338e37df31ac06db4ed67d6d0ca11185f1275 Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Sun, 9 Dec 2018 18:00:53 -0800 Subject: [PATCH] Enforce rustfmt in CI --- .circleci/config.yml | 2 ++ tokio-postgres/src/types/chrono_04.rs | 18 +++++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2cb94e20..3af99449 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -28,6 +28,8 @@ jobs: - image: sfackler/rust-postgres-test:5 steps: - checkout + - run: rustup component add rustfmt + - run: cargo fmt --all -- --check - *RESTORE_REGISTRY - run: cargo generate-lockfile - *SAVE_REGISTRY diff --git a/tokio-postgres/src/types/chrono_04.rs b/tokio-postgres/src/types/chrono_04.rs index 212ba6ee..91ec6a80 100644 --- a/tokio-postgres/src/types/chrono_04.rs +++ b/tokio-postgres/src/types/chrono_04.rs @@ -41,7 +41,11 @@ impl<'a> FromSql<'a> for DateTime { } impl ToSql for DateTime { - fn to_sql(&self, type_: &Type, w: &mut Vec) -> Result> { + fn to_sql( + &self, + type_: &Type, + w: &mut Vec, + ) -> Result> { self.naive_utc().to_sql(type_, w) } @@ -59,7 +63,11 @@ impl<'a> FromSql<'a> for DateTime { } impl ToSql for DateTime { - fn to_sql(&self, type_: &Type, w: &mut Vec) -> Result> { + fn to_sql( + &self, + type_: &Type, + w: &mut Vec, + ) -> Result> { self.with_timezone(&Utc).to_sql(type_, w) } @@ -80,7 +88,11 @@ impl<'a> FromSql<'a> for DateTime { } impl ToSql for DateTime { - fn to_sql(&self, type_: &Type, w: &mut Vec) -> Result> { + fn to_sql( + &self, + type_: &Type, + w: &mut Vec, + ) -> Result> { self.with_timezone(&Utc).to_sql(type_, w) }