mirror of
https://github.com/MingweiSamuel/Riven.git
synced 2024-12-27 11:26:31 +00:00
get_optional parse Option to allow 'null' body
This commit is contained in:
parent
14e6faa24e
commit
b15672baaa
1 changed files with 2 additions and 3 deletions
|
@ -89,9 +89,8 @@ impl RiotApi {
|
|||
}
|
||||
let retries = rinfo.retries;
|
||||
let status = rinfo.response.status();
|
||||
let value = rinfo.response.json::<T>().await;
|
||||
value.map(|v| Some(v))
|
||||
.map_err(|e| RiotApiError::new(e, retries, None, Some(status)))
|
||||
let value = rinfo.response.json::<Option<T>>().await;
|
||||
value.map_err(|e| RiotApiError::new(e, retries, None, Some(status)))
|
||||
}
|
||||
|
||||
/// This method is not meant to be used directly.
|
||||
|
|
Loading…
Reference in a new issue