Use match instead of if-let in sync_forever.
parent
9e48b7172b
commit
32737a5517
|
@ -1310,15 +1310,13 @@ impl Client {
|
||||||
loop {
|
loop {
|
||||||
let response = self.sync(sync_settings.clone()).await;
|
let response = self.sync(sync_settings.clone()).await;
|
||||||
|
|
||||||
let response = if let Ok(r) = response {
|
let response = match response {
|
||||||
r
|
Ok(r) => r,
|
||||||
} else {
|
Err(e) => {
|
||||||
let err = response.unwrap_err();
|
error!("Received an invalid response: {}", e);
|
||||||
error!("Received an invalid response: {}", err);
|
|
||||||
|
|
||||||
sleep::new(Duration::from_secs(1)).await;
|
sleep::new(Duration::from_secs(1)).await;
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO send out to-device messages here
|
// TODO send out to-device messages here
|
||||||
|
|
Loading…
Reference in New Issue