style: rustfmt

This commit is contained in:
Ryan Leckey
2021-04-16 11:49:47 -07:00
parent 4c0896bc14
commit 3d575495e7
12 changed files with 41 additions and 46 deletions

View File

@@ -1,7 +1,8 @@
use sqlx_core::{DatabaseError, Error};
use std::error::Error as StdError;
use std::fmt::{self, Display, Formatter};
use sqlx_core::{DatabaseError, Error};
use crate::PgNotice;
/// An error returned from the PostgreSQL database.

View File

@@ -1,14 +1,16 @@
use crate::PgClientError;
use bytes::{Buf, Bytes};
use bytestring::ByteString;
use memchr::memchr;
use sqlx_core::io::Deserialize;
use std::convert::TryFrom;
use std::fmt;
use std::fmt::{Debug, Display, Formatter};
use std::num::NonZeroU8;
use std::str::{from_utf8, FromStr};
use bytes::{Buf, Bytes};
use bytestring::ByteString;
use memchr::memchr;
use sqlx_core::io::Deserialize;
use crate::PgClientError;
#[derive(Debug, Copy, Clone, PartialEq)]
#[repr(u8)]
pub enum PgNoticeSeverity {
@@ -374,7 +376,10 @@ mod tests {
assert!(notice.severity.is_error());
assert_eq!(notice.severity, PgNoticeSeverity::Fatal);
assert_eq!(notice.message, "failed to parse error received from postgres, likely invalid authentication, confirm connection information and check database logs");
assert_eq!(
notice.message,
"failed to parse error received from postgres, likely invalid authentication, confirm connection information and check database logs"
);
assert_eq!(notice.code, "28P01");
Ok(())

View File

@@ -7,11 +7,9 @@ use sqlx_core::io::{BufStream, Deserialize, Serialize, Stream};
use sqlx_core::net::Stream as NetStream;
use sqlx_core::{Result, Runtime};
use crate::protocol::backend::{BackendMessage, BackendMessageType};
use crate::protocol::frontend::Terminate;
use crate::{
protocol::backend::{BackendMessage, BackendMessageType},
PgDatabaseError, PgNotice,
};
use crate::{PgDatabaseError, PgNotice};
/// Reads and writes messages to and from the PostgreSQL database server.
///