Skip to content

Commit

Permalink
style: rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
mehcode committed Jul 3, 2020
1 parent c82cf8f commit 65222a6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions sqlx-core/src/postgres/types/interval.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use std::convert::{TryFrom, TryInto};
use std::mem;
use std::convert::{TryInto, TryFrom};

use byteorder::{NetworkEndian, ReadBytesExt};

Expand Down Expand Up @@ -47,7 +47,9 @@ impl<'de> Decode<'de, Postgres> for PgInterval {
}

// TODO: Implement parsing of text mode
PgValueFormat::Text => Err("not implemented: decode `INTERVAL` in text mode (unprepared queries)".into()),
PgValueFormat::Text => {
Err("not implemented: decode `INTERVAL` in text mode (unprepared queries)".into())
}
}
}
}
Expand Down Expand Up @@ -83,7 +85,9 @@ impl Type<Postgres> for [std::time::Duration] {

impl Encode<'_, Postgres> for std::time::Duration {
fn encode_by_ref(&self, buf: &mut PgArgumentBuffer) -> IsNull {
PgInterval::try_from(*self).expect("failed to encode `std::time::Duration`").encode_by_ref(buf)
PgInterval::try_from(*self)
.expect("failed to encode `std::time::Duration`")
.encode_by_ref(buf)
}

fn size_hint(&self) -> usize {
Expand Down
2 changes: 1 addition & 1 deletion sqlx-core/src/postgres/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
//!
//! [`PgInterval`]: struct.PgInterval.html
//! [`PgRange<T>`]: struct.PgRange.html
//!
//!
//! ### [`chrono`](https://crates.io/crates/chrono)
//!
//! Requires the `chrono` Cargo feature flag.
Expand Down

0 comments on commit 65222a6

Please sign in to comment.