moving stuff around make work no publish thanks

This commit is contained in:
Zynh0722 2024-02-09 01:07:42 -08:00
parent 595553dcaf
commit fdad6dd0c4
3 changed files with 4 additions and 7 deletions

View file

@ -44,7 +44,7 @@ log = "0.4"
num_enum = "0.5" num_enum = "0.5"
parking_lot = "0.12" parking_lot = "0.12"
reqwest = { version = "0.11", default-features = false, features = [ "gzip", "json" ] } 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 } scan_fmt = { version = "0.2", default-features = false }
serde = { version = "1.0", features = [ "derive" ] } serde = { version = "1.0", features = [ "derive" ] }
serde_json = "1.0" serde_json = "1.0"

View file

@ -2,7 +2,7 @@
use std::time::Duration; use std::time::Duration;
use reqwest::header::{HeaderMap, HeaderValue}; use reqwest::header::{HeaderMap, HeaderValue};
use reqwest::ClientBuilder; use reqwest_middleware::ClientBuilder;
/// Configuration for instantiating RiotApi. /// Configuration for instantiating RiotApi.
#[derive(Debug)] #[derive(Debug)]
@ -80,7 +80,7 @@ impl RiotApiConfig {
method_rate_usage_factor: Self::DEFAULT_RATE_USAGE_FACTOR, method_rate_usage_factor: Self::DEFAULT_RATE_USAGE_FACTOR,
burst_factor: Self::PRECONFIG_BURST_BURST_FACTOR, burst_factor: Self::PRECONFIG_BURST_BURST_FACTOR,
duration_overhead: Self::PRECONFIG_BURST_DURATION_OVERHEAD, 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())),
} }
} }

View file

@ -60,10 +60,7 @@ impl RiotApi {
.expect("CLIENT_BUILDER IN CONFIG SHOULD NOT BE NONE."); .expect("CLIENT_BUILDER IN CONFIG SHOULD NOT BE NONE.");
Self { Self {
config, config,
client: client_builder client: client_builder.build(),
.build()
.expect("Failed to create client from builder.")
.into(),
regional_requesters: InsertOnlyCHashMap::new(), regional_requesters: InsertOnlyCHashMap::new(),
} }
} }