mirror of
https://github.com/MingweiSamuel/Riven.git
synced 2024-12-26 02:46:31 +00:00
style: cleanups for clippy
This commit is contained in:
parent
78c88a0a3f
commit
a7f72cd21a
3 changed files with 102 additions and 106 deletions
|
@ -13,6 +13,5 @@ pub use token_bucket::*;
|
|||
mod regional_requester;
|
||||
pub use regional_requester::*;
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "token_bucket.test.rs"]
|
||||
mod token_bucket_test;
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
use std::future::Future;
|
||||
|
||||
use memo_map::MemoMap;
|
||||
use reqwest::{RequestBuilder, StatusCode};
|
||||
|
@ -30,13 +29,12 @@ impl RegionalRequester {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn execute<'a>(
|
||||
pub async fn execute<'a>(
|
||||
&'a self,
|
||||
config: &'a RiotApiConfig,
|
||||
method_id: &'static str,
|
||||
request: RequestBuilder,
|
||||
) -> impl Future<Output = Result<ResponseInfo>> + 'a {
|
||||
async move {
|
||||
) -> Result<ResponseInfo> {
|
||||
let mut retries: u8 = 0;
|
||||
loop {
|
||||
let method_rate_limit = self
|
||||
|
@ -143,7 +141,6 @@ impl RegionalRequester {
|
|||
retries += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
|
|
@ -318,7 +318,7 @@ pub async fn spectator_v5_combo(route: PlatformRoute) -> Result<(), String> {
|
|||
|
||||
let livegame_p = riot_api()
|
||||
.spectator_v5()
|
||||
.get_current_game_info_by_puuid(route, &puuid);
|
||||
.get_current_game_info_by_puuid(route, puuid);
|
||||
let livegame_o = livegame_p.await.map_err(|e| {
|
||||
format!(
|
||||
"Failed to get live game {} for summoner PUUID {}: {}",
|
||||
|
@ -360,7 +360,7 @@ pub async fn spectator_tft_v5_combo(route: PlatformRoute) -> Result<(), String>
|
|||
|
||||
let livegame_p = riot_api()
|
||||
.spectator_tft_v5()
|
||||
.get_current_game_info_by_puuid(route, &puuid);
|
||||
.get_current_game_info_by_puuid(route, puuid);
|
||||
let livegame_o = livegame_p.await.map_err(|e| {
|
||||
format!(
|
||||
"Failed to get live game {} for summoner PUUID {}: {}",
|
||||
|
|
Loading…
Reference in a new issue