Skip to content

Commit 987beaa

Browse files
downloader: Switch to url::Url
This will help with swapping HTTP backends in the future
1 parent 9e9b298 commit 987beaa

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ tokio = { workspace = true }
1313
prost = { workspace = true }
1414
reqwest = "0.12"
1515
tokio-util = { version = "0.7", features = ["rt"] }
16+
url = "2.5.4"
1617

1718
[build-dependencies]
1819
tonic-build = "0.12.3"

src/downloader/manager.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ use super::{
33
DownloadRequest,
44
};
55
use crate::{error::DownloadError, Error};
6-
use reqwest::{Client, Url};
6+
use reqwest::Client;
77
use std::{path::Path, sync::Arc};
88
use tokio::sync::{mpsc, Semaphore};
99
use tokio_util::{sync::CancellationToken, task::TaskTracker};
10+
use url::Url;
1011

1112
#[derive(Debug)]
1213
pub struct DownloadManager {

src/downloader/request.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use super::{DownloadConfig, DownloadHandle, DownloadManager, DownloadProgress, Status};
22
use crate::{error::DownloadError, Error};
3-
use reqwest::Url;
43
use std::{
54
path::{Path, PathBuf},
65
time::{Duration, Instant},
@@ -10,6 +9,7 @@ use tokio::{
109
sync::{oneshot, watch},
1110
};
1211
use tokio_util::sync::CancellationToken;
12+
use url::Url;
1313

1414
#[derive(Debug)]
1515
pub struct DownloadRequest {

0 commit comments

Comments
 (0)