summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSebastian Holmin <sebastian.holmin@mullvad.net>2025-04-22 13:27:28 +0200
committerSebastian Holmin <sebastian.holmin@mullvad.net>2025-04-23 10:46:29 +0200
commitfc4d6176ac0c26bb85bca693b28b3b6f663e4487 (patch)
tree356b4996ceaf8fdaeb61f280e53607ed463e6f72
parent735e9cd7cabf44e9a220bc719693cf38134c3897 (diff)
downloadmullvadvpn-fc4d6176ac0c26bb85bca693b28b3b6f663e4487.tar.xz
mullvadvpn-fc4d6176ac0c26bb85bca693b28b3b6f663e4487.zip
Remove `async_trait` for `AppDownloader`
-rw-r--r--installer-downloader/src/ui_downloader.rs1
-rw-r--r--installer-downloader/tests/mock.rs1
-rw-r--r--mullvad-update/src/client/app.rs10
3 files changed, 4 insertions, 8 deletions
diff --git a/installer-downloader/src/ui_downloader.rs b/installer-downloader/src/ui_downloader.rs
index c69b1f9599..a31e9e75eb 100644
--- a/installer-downloader/src/ui_downloader.rs
+++ b/installer-downloader/src/ui_downloader.rs
@@ -33,7 +33,6 @@ impl<Delegate: AppDelegate, Downloader: AppDownloader + Send + 'static>
}
}
-#[async_trait::async_trait]
impl<Delegate: AppDelegate, Downloader: AppDownloader + Send + 'static> AppDownloader
for UiAppDownloader<Delegate, Downloader>
{
diff --git a/installer-downloader/tests/mock.rs b/installer-downloader/tests/mock.rs
index 51a20f347d..3cb1bd7807 100644
--- a/installer-downloader/tests/mock.rs
+++ b/installer-downloader/tests/mock.rs
@@ -88,7 +88,6 @@ pub struct FakeAppDownloader<
params: UiAppDownloaderParameters<FakeAppDelegate>,
}
-#[async_trait::async_trait]
impl<const EXE_SUCCEED: bool, const VERIFY_SUCCEED: bool, const LAUNCH_SUCCEED: bool> AppDownloader
for FakeAppDownloader<EXE_SUCCEED, VERIFY_SUCCEED, LAUNCH_SUCCEED>
{
diff --git a/mullvad-update/src/client/app.rs b/mullvad-update/src/client/app.rs
index 6b894dd201..90dc4314e2 100644
--- a/mullvad-update/src/client/app.rs
+++ b/mullvad-update/src/client/app.rs
@@ -2,7 +2,7 @@
//! This module implements the flow of downloading and verifying the app.
-use std::{ffi::OsString, path::PathBuf, time::Duration};
+use std::{ffi::OsString, future::Future, path::PathBuf, time::Duration};
use tokio::{process::Command, time::timeout};
@@ -39,16 +39,15 @@ pub struct AppDownloaderParameters<AppProgress> {
}
/// See the [module-level documentation](self).
-#[async_trait::async_trait]
pub trait AppDownloader: Send {
/// Download the app binary.
- async fn download_executable(&mut self) -> Result<(), DownloadError>;
+ fn download_executable(&mut self) -> impl Future<Output = Result<(), DownloadError>> + Send;
/// Verify the app signature.
- async fn verify(&mut self) -> Result<(), DownloadError>;
+ fn verify(&mut self) -> impl Future<Output = Result<(), DownloadError>> + Send;
/// Execute installer.
- async fn install(&mut self) -> Result<(), DownloadError>;
+ fn install(&mut self) -> impl Future<Output = Result<(), DownloadError>> + Send;
}
/// How long to wait for the installer to exit before returning
@@ -80,7 +79,6 @@ impl<AppProgress: ProgressUpdater> From<AppDownloaderParameters<AppProgress>>
}
}
-#[async_trait::async_trait]
impl<AppProgress: ProgressUpdater> AppDownloader for HttpAppDownloader<AppProgress> {
async fn download_executable(&mut self) -> Result<(), DownloadError> {
let bin_path = self.bin_path();