Skip to content

Commit f754391

Browse files
committed
Consume self in handshake
1 parent de09725 commit f754391

File tree

4 files changed

+3
-5
lines changed

4 files changed

+3
-5
lines changed

postgres-tokio/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,6 @@ impl Connection {
238238

239239
fn handle_auth_response(self, message: Vec<u8>) -> BoxFuture<Connection, ConnectError> {
240240
self.0.send(message)
241-
.and_then(|s| s.flush())
242241
.and_then(|s| s.read())
243242
.map_err(ConnectError::Io)
244243
.and_then(|(m, s)| {
@@ -277,7 +276,6 @@ impl Connection {
277276
.map(|()| buf)
278277
.into_future()
279278
.and_then(move |buf| self.0.send(buf))
280-
.and_then(|s| s.flush())
281279
.map_err(Error::Io)
282280
.and_then(|s| Connection(s).simple_read_rows(vec![]))
283281
.boxed()

postgres-tokio/src/stream.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ pub fn connect(host: Host,
3434
}
3535
};
3636

37-
let (required, mut handshaker) = match tls_mode {
37+
let (required, handshaker) = match tls_mode {
3838
TlsMode::Require(h) => (true, h),
3939
TlsMode::Prefer(h) => (false, h),
4040
TlsMode::None => {

postgres-tokio/src/tls/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ impl TlsStream for Stream {
2626
}
2727

2828
pub trait Handshake: 'static + Sync + Send {
29-
fn handshake(&mut self,
29+
fn handshake(self: Box<Self>,
3030
host: &str,
3131
stream: Stream)
3232
-> BoxFuture<Box<TlsStream>, Box<Error + Sync + Send>>;

postgres-tokio/src/tls/openssl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ impl From<SslConnector> for OpenSsl {
3232
}
3333

3434
impl Handshake for OpenSsl {
35-
fn handshake(&mut self,
35+
fn handshake(self: Box<Self>,
3636
host: &str,
3737
stream: Stream)
3838
-> BoxFuture<Box<TlsStream>, Box<Error + Sync + Send>> {

0 commit comments

Comments
 (0)