mirror of
https://github.com/launchbadge/sqlx.git
synced 2026-03-21 09:34:02 +00:00
style: rustfmt
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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(())
|
||||
|
||||
@@ -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.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user