Enforce rustfmt in CI
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -41,7 +41,11 @@ impl<'a> FromSql<'a> for DateTime<Utc> {
|
||||
}
|
||||
|
||||
impl ToSql for DateTime<Utc> {
|
||||
fn to_sql(&self, type_: &Type, w: &mut Vec<u8>) -> Result<IsNull, Box<dyn Error + Sync + Send>> {
|
||||
fn to_sql(
|
||||
&self,
|
||||
type_: &Type,
|
||||
w: &mut Vec<u8>,
|
||||
) -> Result<IsNull, Box<dyn Error + Sync + Send>> {
|
||||
self.naive_utc().to_sql(type_, w)
|
||||
}
|
||||
|
||||
@@ -59,7 +63,11 @@ impl<'a> FromSql<'a> for DateTime<Local> {
|
||||
}
|
||||
|
||||
impl ToSql for DateTime<Local> {
|
||||
fn to_sql(&self, type_: &Type, w: &mut Vec<u8>) -> Result<IsNull, Box<dyn Error + Sync + Send>> {
|
||||
fn to_sql(
|
||||
&self,
|
||||
type_: &Type,
|
||||
w: &mut Vec<u8>,
|
||||
) -> Result<IsNull, Box<dyn Error + Sync + Send>> {
|
||||
self.with_timezone(&Utc).to_sql(type_, w)
|
||||
}
|
||||
|
||||
@@ -80,7 +88,11 @@ impl<'a> FromSql<'a> for DateTime<FixedOffset> {
|
||||
}
|
||||
|
||||
impl ToSql for DateTime<FixedOffset> {
|
||||
fn to_sql(&self, type_: &Type, w: &mut Vec<u8>) -> Result<IsNull, Box<dyn Error + Sync + Send>> {
|
||||
fn to_sql(
|
||||
&self,
|
||||
type_: &Type,
|
||||
w: &mut Vec<u8>,
|
||||
) -> Result<IsNull, Box<dyn Error + Sync + Send>> {
|
||||
self.with_timezone(&Utc).to_sql(type_, w)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user