|
|
|
@ -383,15 +383,15 @@ impl Updater {
|
|
|
|
|
.send()
|
|
|
|
|
.await;
|
|
|
|
|
|
|
|
|
|
if let Ok(res) = response {
|
|
|
|
|
match response {
|
|
|
|
|
Ok(res) => {
|
|
|
|
|
if res.status().is_success() {
|
|
|
|
|
// no updates found!
|
|
|
|
|
if StatusCode::NO_CONTENT == res.status() {
|
|
|
|
|
return Ok(None);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
raw_json = Some(res.json().await?);
|
|
|
|
|
match serde_json::from_value::<RemoteRelease>(raw_json.clone().unwrap())
|
|
|
|
|
match serde_json::from_value::<RemoteRelease>(res.json().await?)
|
|
|
|
|
.map_err(Into::into)
|
|
|
|
|
{
|
|
|
|
|
Ok(release) => {
|
|
|
|
@ -404,6 +404,8 @@ impl Updater {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Err(err) => last_error = Some(err.into()),
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Last error is cleaned on success.
|
|
|
|
|