Merge pull request #169 from erickt/bump

Update to futures-preview 0.3.0-alpha.11 and rustc 1.33.0-nightly
diff --git a/Cargo.toml b/Cargo.toml
index 280e4cf..46d4900 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -25,8 +25,7 @@
 chrono = { version = "0.4", features = [ "serde" ] }
 data-encoding = "2.0.0-rc.2"
 derp = "0.0.11"
-futures_01 = { version = "0.1", package = "futures" }
-futures-preview = { version = "0.3.0-alpha.10", features = [ "compat" ] }
+futures-preview = { version = "0.3.0-alpha.11", features = [ "compat" ] }
 http = "0.1"
 hyper = { version = "0.12", default-features = false }
 itoa = "0.4"
diff --git a/src/client.rs b/src/client.rs
index f306552..a4032ad 100644
--- a/src/client.rs
+++ b/src/client.rs
@@ -3,7 +3,7 @@
 //! # Example
 //!
 //! ```no_run
-//! #![feature(async_await, await_macro, futures_api, pin)]
+//! #![feature(async_await, await_macro, futures_api)]
 //! # use futures::executor::block_on;
 //! # use hyper::client::Client as HttpClient;
 //! # use std::path::PathBuf;
@@ -62,7 +62,7 @@
 };
 use crate::repository::Repository;
 use crate::tuf::Tuf;
-use crate::Result;
+use crate::{Result, TufFuture};
 
 /// Translates real paths (where a file is stored) into virtual paths (how it is addressed in TUF)
 /// and back.
@@ -139,12 +139,8 @@
         let root_path = MetadataPath::from_role(&Role::Root);
         let root_version = MetadataVersion::Number(1);
 
-        let root = await!(local.fetch_metadata(
-            &root_path,
-            &root_version,
-            &config.max_root_size,
-            None,
-        ))?;
+        let root =
+            await!(local.fetch_metadata(&root_path, &root_version, &config.max_root_size, None))?;
 
         let tuf = Tuf::from_root(root)?;
 
@@ -441,10 +437,7 @@
             await!(self.lookup_target_description(false, 0, &virt, &snapshot, None));
         let target_description = target_description?;
 
-        await!(self.remote.fetch_target(
-            target,
-            &target_description,
-        ))
+        await!(self.remote.fetch_target(target, &target_description))
     }
 
     async fn lookup_target_description<'a>(
@@ -567,13 +560,14 @@
                         .get(delegation.role())
                         .unwrap()
                         .clone();
-                    let (term, res) = await!(Box::pinned(self.lookup_target_description(
+                    let (term, res) = await!(Box::pin(self.lookup_target_description(
                         delegation.terminating(),
                         current_depth + 1,
                         target,
                         snapshot,
                         Some(meta.as_ref()),
-                    )));
+                    ))
+                        as TufFuture<(bool, Result<TargetDescription>)>);
 
                     if term && res.is_err() {
                         return (true, res);
diff --git a/src/lib.rs b/src/lib.rs
index 3eb3ac0..2d0585b 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -109,7 +109,7 @@
     clippy::op_ref,
     clippy::too_many_arguments
 )]
-#![feature(async_await, await_macro, futures_api, pin)]
+#![feature(async_await, await_macro, futures_api)]
 
 pub mod client;
 pub mod crypto;
diff --git a/src/repository.rs b/src/repository.rs
index 50f1923..5d1babc 100644
--- a/src/repository.rs
+++ b/src/repository.rs
@@ -132,7 +132,7 @@
     where
         M: Metadata + 'static,
     {
-        Box::pinned(
+        Box::pin(
             async move {
                 Self::check::<M>(meta_path)?;
 
@@ -163,7 +163,7 @@
     where
         M: Metadata + 'static,
     {
-        Box::pinned(
+        Box::pin(
             async move {
                 Self::check::<M>(&meta_path)?;
 
@@ -193,7 +193,7 @@
     where
         R: AsyncRead + 'a,
     {
-        Box::pinned(
+        Box::pin(
             async move {
                 let mut path = self.local_path.join("targets");
                 path.extend(target_path.components());
@@ -216,7 +216,7 @@
         target_path: &'a TargetPath,
         target_description: &'a TargetDescription,
     ) -> TufFuture<'a, Result<Box<dyn AsyncRead>>> {
-        Box::pinned(
+        Box::pin(
             async move {
                 let mut path = self.local_path.join("targets");
                 path.extend(target_path.components());
@@ -406,7 +406,7 @@
     where
         M: Metadata + 'static,
     {
-        Box::pinned(
+        Box::pin(
             async {
                 Err(Error::Opaque(
                     "Http repo store metadata not implemented".to_string(),
@@ -425,7 +425,7 @@
     where
         M: Metadata + 'static,
     {
-        Box::pinned(
+        Box::pin(
             async move {
                 Self::check::<M>(meta_path)?;
 
@@ -457,7 +457,7 @@
     where
         R: AsyncRead + 'a,
     {
-        Box::pinned(async { Err(Error::Opaque("Http repo store not implemented".to_string())) })
+        Box::pin(async { Err(Error::Opaque("Http repo store not implemented".to_string())) })
     }
 
     fn fetch_target<'a>(
@@ -465,7 +465,7 @@
         target_path: &'a TargetPath,
         target_description: &'a TargetDescription,
     ) -> TufFuture<'a, Result<Box<dyn AsyncRead>>> {
-        Box::pinned(
+        Box::pin(
             async move {
                 let (alg, value) = crypto::hash_preference(target_description.hashes())?;
                 let components = target_path.components();
@@ -537,7 +537,7 @@
     where
         M: Metadata + 'static,
     {
-        Box::pinned(
+        Box::pin(
             async move {
                 Self::check::<M>(meta_path)?;
                 let mut buf = Vec::new();
@@ -559,7 +559,7 @@
     where
         M: Metadata + 'static,
     {
-        Box::pinned(
+        Box::pin(
             async move {
                 Self::check::<M>(meta_path)?;
 
@@ -592,7 +592,7 @@
     where
         R: AsyncRead + 'a,
     {
-        Box::pinned(
+        Box::pin(
             async move {
                 println!("EphemeralRepository.store_target: {:?}", target_path);
                 let mut buf = Vec::new();
@@ -609,7 +609,7 @@
         target_path: &'a TargetPath,
         target_description: &'a TargetDescription,
     ) -> TufFuture<'a, Result<Box<dyn AsyncRead>>> {
-        Box::pinned(
+        Box::pin(
             async move {
                 let targets = self.targets.read().unwrap();
                 match targets.get(target_path) {
@@ -701,8 +701,7 @@
                 // This is needed for `tempfile` on Windows, which doesn't open the
                 // files in a mode that allows the file to be opened multiple times.
                 {
-                    let mut read =
-                        await!(repo.fetch_target(&path, &target_description)).unwrap();
+                    let mut read = await!(repo.fetch_target(&path, &target_description)).unwrap();
                     await!(read.read_to_end(&mut buf)).unwrap();
                     assert_eq!(buf.as_slice(), data);
                 }
diff --git a/tests/simple_example.rs b/tests/simple_example.rs
index 2961e46..3a43b4c 100644
--- a/tests/simple_example.rs
+++ b/tests/simple_example.rs
@@ -1,4 +1,4 @@
-#![feature(async_await, await_macro, futures_api, pin)]
+#![feature(async_await, await_macro, futures_api)]
 
 extern crate chrono;
 extern crate futures;