mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-12-30 05:11:13 +00:00
Remove useless flush fn on postgres raw conn
This commit is contained in:
parent
37c22eb55d
commit
45f1c02027
@ -38,7 +38,7 @@ pub async fn establish<'a, 'b: 'a>(
|
||||
let message = StartupMessage { params };
|
||||
|
||||
conn.write(message);
|
||||
conn.flush().await?;
|
||||
conn.stream.flush().await?;
|
||||
|
||||
while let Some(message) = conn.receive().await? {
|
||||
match message {
|
||||
@ -52,7 +52,7 @@ pub async fn establish<'a, 'b: 'a>(
|
||||
// FIXME: Should error early (before send) if the user did not supply a password
|
||||
conn.write(PasswordMessage::Cleartext(password));
|
||||
|
||||
conn.flush().await?;
|
||||
conn.stream.flush().await?;
|
||||
}
|
||||
|
||||
Authentication::Md5Password { salt } => {
|
||||
@ -63,7 +63,7 @@ pub async fn establish<'a, 'b: 'a>(
|
||||
salt,
|
||||
});
|
||||
|
||||
conn.flush().await?;
|
||||
conn.stream.flush().await?;
|
||||
}
|
||||
|
||||
auth => {
|
||||
|
||||
@ -3,7 +3,7 @@ use crate::{error::Error, postgres::protocol::Message};
|
||||
use std::io;
|
||||
|
||||
pub async fn execute(conn: &mut PostgresRawConnection) -> Result<u64, Error> {
|
||||
conn.flush().await?;
|
||||
conn.stream.flush().await?;
|
||||
|
||||
let mut rows = 0;
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@ pub fn fetch<'a>(
|
||||
conn: &'a mut PostgresRawConnection,
|
||||
) -> impl Stream<Item = Result<PostgresRow, Error>> + 'a {
|
||||
async_stream::try_stream! {
|
||||
conn.flush().await?;
|
||||
conn.stream.flush().await.map_err(Error::Io)?;
|
||||
|
||||
while let Some(message) = conn.receive().await? {
|
||||
match message {
|
||||
|
||||
@ -5,7 +5,7 @@ use std::io;
|
||||
pub async fn fetch_optional<'a>(
|
||||
conn: &'a mut PostgresRawConnection,
|
||||
) -> Result<Option<PostgresRow>, Error> {
|
||||
conn.flush().await?;
|
||||
conn.stream.flush().await?;
|
||||
|
||||
let mut row: Option<PostgresRow> = None;
|
||||
|
||||
|
||||
@ -123,12 +123,6 @@ impl PostgresRawConnection {
|
||||
pub(super) fn write(&mut self, message: impl Encode) {
|
||||
message.encode(self.stream.buffer_mut());
|
||||
}
|
||||
|
||||
async fn flush(&mut self) -> Result<(), Error> {
|
||||
self.stream.flush().await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
impl RawConnection for PostgresRawConnection {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user