Skip to content

Commit 04def92

Browse files
Swap out talpid-core for talpid-future
1 parent abe253d commit 04def92

File tree

13 files changed

+46
-1154
lines changed

13 files changed

+46
-1154
lines changed

Cargo.lock

+3-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mullvad-daemon/Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,10 @@ mullvad-api = { path = "../mullvad-api" }
3434
mullvad-fs = { path = "../mullvad-fs" }
3535
mullvad-version = { path = "../mullvad-version" }
3636
talpid-core = { path = "../talpid-core" }
37-
talpid-types = { path = "../talpid-types" }
37+
talpid-future = { path = "../talpid-future" }
3838
talpid-platform-metadata = { path = "../talpid-platform-metadata" }
3939
talpid-time = { path = "../talpid-time" }
40+
talpid-types = { path = "../talpid-types" }
4041

4142
[target.'cfg(not(target_os="android"))'.dependencies]
4243
clap = { workspace = true }

mullvad-daemon/src/device/service.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use mullvad_api::{
1717
rest::{self, MullvadRestHandle},
1818
AccountsProxy, DevicesProxy,
1919
};
20-
use talpid_core::future_retry::{retry_future, ConstantInterval, ExponentialBackoff, Jittered};
20+
use talpid_future::retry::{retry_future, ConstantInterval, ExponentialBackoff, Jittered};
2121
/// Retry strategy used for user-initiated actions that require immediate feedback
2222
const RETRY_ACTION_STRATEGY: ConstantInterval = ConstantInterval::new(Duration::ZERO, Some(3));
2323
/// Retry strategy used for background tasks

mullvad-daemon/src/geoip.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@ use mullvad_api::{
77
};
88
use mullvad_types::location::{AmIMullvad, GeoIpLocation, LocationEventData};
99
use once_cell::sync::Lazy;
10-
use talpid_core::{
11-
future_retry::{retry_future, ExponentialBackoff, Jittered},
12-
mpsc::Sender,
13-
};
10+
use talpid_core::mpsc::Sender;
11+
use talpid_future::retry::{retry_future, ExponentialBackoff, Jittered};
1412
use talpid_types::ErrorExt;
1513

1614
use crate::{DaemonEventSender, InternalDaemonEvent};

mullvad-daemon/src/version_check.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ use std::{
1515
str::FromStr,
1616
time::Duration,
1717
};
18-
use talpid_core::{future_retry::ConstantInterval, mpsc::Sender};
18+
use talpid_core::mpsc::Sender;
19+
use talpid_future::retry::{retry_future, ConstantInterval};
1920
use talpid_types::ErrorExt;
2021
use tokio::fs::{self, File};
2122

@@ -193,7 +194,7 @@ impl VersionUpdater {
193194
.map_err(Error::Download)
194195
};
195196

196-
Box::pin(talpid_core::future_retry::retry_future(
197+
Box::pin(retry_future(
197198
download_future_factory,
198199
move |result| Self::should_retry_immediate(result, &api_handle),
199200
IMMEDIATE_RETRY_STRATEGY,
@@ -233,7 +234,7 @@ impl VersionUpdater {
233234
}
234235
};
235236

236-
Box::pin(talpid_core::future_retry::retry_future(
237+
Box::pin(retry_future(
237238
download_future_factory,
238239
|result| result.is_err(),
239240
std::iter::repeat(UPDATE_INTERVAL_ERROR),

mullvad-relay-selector/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ rand = "0.8.5"
2121
serde_json = "1.0"
2222
tokio = { workspace = true, features = ["fs", "io-util", "time"] }
2323

24-
talpid-core = { path = "../talpid-core" }
24+
talpid-future = { path = "../talpid-future" }
2525
talpid-types = { path = "../talpid-types" }
2626
mullvad-api = { path = "../mullvad-api" }
2727
mullvad-types = { path = "../mullvad-types" }

mullvad-relay-selector/src/updater.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use std::{
1212
sync::Arc,
1313
time::{Duration, SystemTime, UNIX_EPOCH},
1414
};
15-
use talpid_core::future_retry::{retry_future, ExponentialBackoff, Jittered};
15+
use talpid_future::retry::{retry_future, ExponentialBackoff, Jittered};
1616
use talpid_types::ErrorExt;
1717
use tokio::fs::File;
1818

mullvad-setup/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,5 @@ mullvad-api = { path = "../mullvad-api" }
3030
mullvad-types = { path = "../mullvad-types" }
3131
mullvad-version = { path = "../mullvad-version" }
3232
talpid-core = { path = "../talpid-core" }
33+
talpid-future = { path = "../talpid-future" }
3334
talpid-types = { path = "../talpid-types" }

mullvad-setup/src/main.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
use clap::Parser;
2+
use once_cell::sync::Lazy;
3+
use std::{path::PathBuf, process, str::FromStr, time::Duration};
4+
25
use mullvad_api::{self, proxy::ApiConnectionMode, DEVICE_NOT_FOUND};
36
use mullvad_management_interface::MullvadProxyClient;
47
use mullvad_types::version::ParsedAppVersion;
5-
use once_cell::sync::Lazy;
6-
use std::{path::PathBuf, process, str::FromStr, time::Duration};
7-
use talpid_core::{
8-
firewall::{self, Firewall},
9-
future_retry::{retry_future, ConstantInterval},
10-
};
8+
use talpid_core::firewall::{self, Firewall};
9+
use talpid_future::retry::{retry_future, ConstantInterval};
1110
use talpid_types::ErrorExt;
1211

1312
static APP_VERSION: Lazy<ParsedAppVersion> =

talpid-core/Cargo.toml

+10-10
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,21 @@ rust-version.workspace = true
1111
workspace = true
1212

1313
[dependencies]
14+
chrono = { workspace = true, features = ["clock"] }
1415
err-derive = { workspace = true }
1516
futures = "0.3.15"
1617
ipnetwork = "0.16"
17-
once_cell = { workspace = true }
1818
libc = "0.2"
1919
log = { workspace = true }
20+
once_cell = { workspace = true }
2021
parking_lot = "0.12.0"
22+
rand = "0.8.5"
2123
talpid-routing = { path = "../talpid-routing" }
22-
talpid-types = { path = "../talpid-types" }
23-
talpid-time = { path = "../talpid-time" }
24-
talpid-tunnel-config-client = { path = "../talpid-tunnel-config-client" }
2524
talpid-tunnel = { path = "../talpid-tunnel" }
25+
talpid-tunnel-config-client = { path = "../talpid-tunnel-config-client" }
26+
talpid-types = { path = "../talpid-types" }
2627
talpid-wireguard = { path = "../talpid-wireguard" }
27-
chrono = { workspace = true, features = ["clock"] }
2828
tokio = { workspace = true, features = ["process", "rt-multi-thread", "fs"] }
29-
rand = "0.8.5"
3029

3130
[target.'cfg(not(target_os="android"))'.dependencies]
3231
talpid-openvpn = { path = "../talpid-openvpn" }
@@ -47,13 +46,14 @@ duct = "0.13"
4746

4847

4948
[target.'cfg(target_os = "macos")'.dependencies]
49+
async-trait = "0.1"
50+
duct = "0.13"
5051
pfctl = "0.4.4"
52+
subslice = "0.2"
5153
system-configuration = "0.5.1"
52-
trust-dns-server = { version = "0.23.0", features = ["resolver"] }
54+
talpid-time = { path = "../talpid-time" }
5355
trust-dns-proto = "0.23.0"
54-
subslice = "0.2"
55-
async-trait = "0.1"
56-
duct = "0.13"
56+
trust-dns-server = { version = "0.23.0", features = ["resolver"] }
5757

5858

5959
[target.'cfg(windows)'.dependencies]

talpid-core/src/future_retry.rs

-151
This file was deleted.

talpid-core/src/lib.rs

-3
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ pub mod dns;
3535
/// State machine to handle tunnel configuration.
3636
pub mod tunnel_state_machine;
3737

38-
/// Future utilities
39-
pub mod future_retry;
40-
4138
/// Misc utilities for the Linux platform.
4239
#[cfg(target_os = "linux")]
4340
mod linux;

0 commit comments

Comments
 (0)