summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDavid Lönnhager <david.l@mullvad.net>2020-09-07 17:34:03 +0200
committerDavid Lönnhager <david.l@mullvad.net>2020-09-07 17:51:16 +0200
commit9f05c347a9d07911ffa4643f2f50cace0c331500 (patch)
treefb3a1162dca265877fee3301bf4cb2bb9ac671d9
parentca8c485cf9c72b7584461a0720fdacf90bf672a4 (diff)
downloadmullvadvpn-9f05c347a9d07911ffa4643f2f50cace0c331500.tar.xz
mullvadvpn-9f05c347a9d07911ffa4643f2f50cace0c331500.zip
Remove futures 0.1 from mullvad-rpc
-rw-r--r--Cargo.lock1
-rw-r--r--mullvad-rpc/Cargo.toml3
-rw-r--r--mullvad-rpc/src/rest.rs17
3 files changed, 1 insertions, 20 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 84cbd3e506..7ecd212fb1 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1241,7 +1241,6 @@ dependencies = [
"chrono 0.4.15 (registry+https://github.com/rust-lang/crates.io-index)",
"err-derive 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"filetime 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
- "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)",
"futures 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"http 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.13.7 (registry+https://github.com/rust-lang/crates.io-index)",
diff --git a/mullvad-rpc/Cargo.toml b/mullvad-rpc/Cargo.toml
index 46c3dcded4..2c98bc5017 100644
--- a/mullvad-rpc/Cargo.toml
+++ b/mullvad-rpc/Cargo.toml
@@ -10,8 +10,7 @@ publish = false
[dependencies]
chrono = { version = "0.4", features = ["serde"] }
err-derive = "0.2.1"
-futures = { version = "0.3", features = [ "default", "compat" ] }
-futures01 = { package = "futures", version = "0.1" }
+futures = "0.3"
http = "0.2"
hyper = "0.13"
ipnetwork = "0.16"
diff --git a/mullvad-rpc/src/rest.rs b/mullvad-rpc/src/rest.rs
index 0e8994b1c3..025c22eaa8 100644
--- a/mullvad-rpc/src/rest.rs
+++ b/mullvad-rpc/src/rest.rs
@@ -5,7 +5,6 @@ use futures::{
stream::StreamExt,
TryFutureExt,
};
-use futures01::Future as OldFuture;
use hyper::{
client::{connect::Connect, Client},
header::{self, HeaderValue},
@@ -194,22 +193,6 @@ impl RequestServiceHandle {
completion_rx.await.map_err(|_| Error::ReceiveError)?
}
- /// Spawns a future on the hyper runtime returning an old-style future that can be spawned on
- /// any runtime
- pub fn compat_spawn<T: Send + std::fmt::Debug + 'static>(
- &self,
- future: impl Future<Output = Result<T>> + Send + 'static,
- ) -> impl futures01::Future<Item = T, Error = Error> {
- let (tx, rx) = futures01::sync::oneshot::channel();
- let _ = self.handle.spawn(async move {
- let result = future.await;
- let _ = tx.send(result);
- });
-
-
- rx.map_err(|_| Error::ReceiveError).flatten()
- }
-
/// Spawns a future on the RPC runtime.
pub fn spawn<T: Send + 'static>(&self, future: impl Future<Output = T> + Send + 'static) {
let _ = self.handle.spawn(future);