From fdad6dd0c4bfaf283166b3101f6503d41aed6f51 Mon Sep 17 00:00:00 2001 From: Zynh0722 Date: Fri, 9 Feb 2024 01:07:42 -0800 Subject: [PATCH] moving stuff around make work no publish thanks --- riven/Cargo.toml | 2 +- riven/src/config.rs | 4 ++-- riven/src/riot_api.rs | 5 +---- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/riven/Cargo.toml b/riven/Cargo.toml index 7d7084c..bc3dd35 100644 --- a/riven/Cargo.toml +++ b/riven/Cargo.toml @@ -44,7 +44,7 @@ log = "0.4" num_enum = "0.5" parking_lot = "0.12" reqwest = { version = "0.11", default-features = false, features = [ "gzip", "json" ] } -reqwest-middleware = "0.2.4" +reqwest-middleware = { git = "https://git.zynh.me/Zynh0722/reqwest-middleware.git" } scan_fmt = { version = "0.2", default-features = false } serde = { version = "1.0", features = [ "derive" ] } serde_json = "1.0" diff --git a/riven/src/config.rs b/riven/src/config.rs index 258f278..e81bd88 100644 --- a/riven/src/config.rs +++ b/riven/src/config.rs @@ -2,7 +2,7 @@ use std::time::Duration; use reqwest::header::{HeaderMap, HeaderValue}; -use reqwest::ClientBuilder; +use reqwest_middleware::ClientBuilder; /// Configuration for instantiating RiotApi. #[derive(Debug)] @@ -80,7 +80,7 @@ impl RiotApiConfig { method_rate_usage_factor: Self::DEFAULT_RATE_USAGE_FACTOR, burst_factor: Self::PRECONFIG_BURST_BURST_FACTOR, duration_overhead: Self::PRECONFIG_BURST_DURATION_OVERHEAD, - client_builder: Some(ClientBuilder::new().default_headers(default_headers)), + client_builder: Some(ClientBuilder::new(reqwest::ClientBuilder::new().default_headers(default_headers).build().unwrap())), } } diff --git a/riven/src/riot_api.rs b/riven/src/riot_api.rs index c705f57..f24a542 100644 --- a/riven/src/riot_api.rs +++ b/riven/src/riot_api.rs @@ -60,10 +60,7 @@ impl RiotApi { .expect("CLIENT_BUILDER IN CONFIG SHOULD NOT BE NONE."); Self { config, - client: client_builder - .build() - .expect("Failed to create client from builder.") - .into(), + client: client_builder.build(), regional_requesters: InsertOnlyCHashMap::new(), } }