From c6a4e94996a0cadbe20b9a360627f9f067f8785a Mon Sep 17 00:00:00 2001 From: Jake Shadle Date: Thu, 17 Oct 2024 10:04:51 +0200 Subject: [PATCH] Fix rebase --- src/ctx.rs | 9 ++++----- src/lib.rs | 2 +- tests/compiles.rs | 4 ++-- tests/deterministic.rs | 2 +- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/ctx.rs b/src/ctx.rs index e45347f..6c07523 100644 --- a/src/ctx.rs +++ b/src/ctx.rs @@ -4,7 +4,6 @@ use crate::{ Path, PathBuf, WorkItem, }; use anyhow::{Context as _, Error}; -use reqwest::blocking::Client; #[allow(dead_code)] pub enum Unpack { @@ -20,12 +19,12 @@ pub enum Unpack { pub struct Ctx { pub work_dir: PathBuf, pub tempdir: Option, - pub client: Client, + pub client: ureq::Agent, pub draw_target: ProgressTarget, } impl Ctx { - pub fn with_temp(dt: ProgressTarget, client: Client) -> Result { + pub fn with_temp(dt: ProgressTarget, client: ureq::Agent) -> Result { let td = tempfile::TempDir::new()?; Ok(Self { @@ -41,7 +40,7 @@ impl Ctx { pub fn with_dir( mut work_dir: PathBuf, dt: ProgressTarget, - client: Client, + client: ureq::Agent, ) -> Result { work_dir.push("dl"); std::fs::create_dir_all(&work_dir)?; @@ -108,7 +107,7 @@ impl Ctx { } } - let mut res = self.client.get(url.as_ref()).send()?; + let res = self.client.get(url.as_ref()).call()?; let content_length = res .headers() diff --git a/src/lib.rs b/src/lib.rs index b212d80..5aad5d6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -17,8 +17,8 @@ pub mod util; pub use ctx::Ctx; pub use minimize::MinimizeConfig; -pub use reqwest; pub use splat::SplatConfig; +pub use ureq; #[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)] pub enum Arch { diff --git a/tests/compiles.rs b/tests/compiles.rs index b62125d..e783d23 100644 --- a/tests/compiles.rs +++ b/tests/compiles.rs @@ -3,7 +3,7 @@ fn verify_compiles() { let ctx = xwin::Ctx::with_dir( xwin::PathBuf::from(".xwin-cache/compile-test"), xwin::util::ProgressTarget::Hidden, - reqwest::blocking::Client::new(), + ureq::agent(), ) .unwrap(); @@ -166,7 +166,7 @@ fn verify_compiles_minimized() { let ctx = xwin::Ctx::with_dir( xwin::PathBuf::from(".xwin-cache/compile-test-minimized"), xwin::util::ProgressTarget::Hidden, - reqwest::blocking::Client::new(), + ureq::agent(), ) .unwrap(); diff --git a/tests/deterministic.rs b/tests/deterministic.rs index 3f75259..4f4960c 100644 --- a/tests/deterministic.rs +++ b/tests/deterministic.rs @@ -6,7 +6,7 @@ fn verify_deterministic() { let ctx = xwin::Ctx::with_dir( PathBuf::from(".xwin-cache/deterministic"), xwin::util::ProgressTarget::Hidden, - reqwest::blocking::Client::new(), + ureq::agent(), ) .unwrap();