Upgrade to tokio 0.2/futures 0.3

This commit is contained in:
Steven Fackler
2019-11-26 16:32:36 -08:00
parent 5517719b07
commit 12c2ef79b6
39 changed files with 210 additions and 258 deletions

View File

@@ -16,12 +16,13 @@ default = ["runtime"]
runtime = ["tokio-postgres/runtime"]
[dependencies]
bytes = "0.5"
futures-preview = "=0.3.0-alpha.19"
native-tls = "0.2"
tokio-io = "=0.2.0-alpha.6"
tokio-tls = "=0.3.0-alpha.6"
tokio = "0.2"
tokio-tls = "0.3"
tokio-postgres = { version = "=0.5.0-alpha.1", path = "../tokio-postgres", default-features = false }
[dev-dependencies]
tokio = "=0.2.0-alpha.6"
tokio = { version = "0.2", features = ["full"] }
postgres = { version = "=0.17.0-alpha.1", path = "../postgres" }

View File

@@ -48,16 +48,17 @@
#![doc(html_root_url = "https://docs.rs/postgres-native-tls/0.3")]
#![warn(rust_2018_idioms, clippy::all, missing_docs)]
use futures::task::Context;
use futures::Poll;
use std::task::{Context, Poll};
use std::future::Future;
use std::io;
use std::pin::Pin;
use tokio_io::{AsyncRead, AsyncWrite, Buf, BufMut};
use tokio::io::{AsyncRead, AsyncWrite};
use bytes::{Buf, BufMut};
use tokio_postgres::tls;
#[cfg(feature = "runtime")]
use tokio_postgres::tls::MakeTlsConnect;
use tokio_postgres::tls::{ChannelBinding, TlsConnect};
use std::mem::MaybeUninit;
#[cfg(test)]
mod test;
@@ -134,7 +135,7 @@ impl<S> AsyncRead for TlsStream<S>
where
S: AsyncRead + AsyncWrite + Unpin,
{
unsafe fn prepare_uninitialized_buffer(&self, buf: &mut [u8]) -> bool {
unsafe fn prepare_uninitialized_buffer(&self, buf: &mut [MaybeUninit<u8>]) -> bool {
self.0.prepare_uninitialized_buffer(buf)
}