mirror of https://github.com/MingweiSamuel/Riven
get_optional parse Option to allow 'null' body
parent
14e6faa24e
commit
b15672baaa
|
@ -89,9 +89,8 @@ impl RiotApi {
|
||||||
}
|
}
|
||||||
let retries = rinfo.retries;
|
let retries = rinfo.retries;
|
||||||
let status = rinfo.response.status();
|
let status = rinfo.response.status();
|
||||||
let value = rinfo.response.json::<T>().await;
|
let value = rinfo.response.json::<Option<T>>().await;
|
||||||
value.map(|v| Some(v))
|
value.map_err(|e| RiotApiError::new(e, retries, None, Some(status)))
|
||||||
.map_err(|e| RiotApiError::new(e, retries, None, Some(status)))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// This method is not meant to be used directly.
|
/// This method is not meant to be used directly.
|
||||||
|
|
Loading…
Reference in New Issue