Skip to content

Commit

Permalink
Fix rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake-Shadle committed Oct 17, 2024
1 parent fb40720 commit c6a4e94
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
9 changes: 4 additions & 5 deletions src/ctx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use crate::{
Path, PathBuf, WorkItem,
};
use anyhow::{Context as _, Error};
use reqwest::blocking::Client;

#[allow(dead_code)]
pub enum Unpack {
Expand All @@ -20,12 +19,12 @@ pub enum Unpack {
pub struct Ctx {
pub work_dir: PathBuf,
pub tempdir: Option<tempfile::TempDir>,
pub client: Client,
pub client: ureq::Agent,
pub draw_target: ProgressTarget,
}

impl Ctx {
pub fn with_temp(dt: ProgressTarget, client: Client) -> Result<Self, Error> {
pub fn with_temp(dt: ProgressTarget, client: ureq::Agent) -> Result<Self, Error> {
let td = tempfile::TempDir::new()?;

Ok(Self {
Expand All @@ -41,7 +40,7 @@ impl Ctx {
pub fn with_dir(
mut work_dir: PathBuf,
dt: ProgressTarget,
client: Client,
client: ureq::Agent,
) -> Result<Self, Error> {
work_dir.push("dl");
std::fs::create_dir_all(&work_dir)?;
Expand Down Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions tests/compiles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion tests/deterministic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit c6a4e94

Please sign in to comment.