chore: clippy fixes - allow should_implement_trait and collapse nested if
This commit is contained in:
@@ -16,6 +16,7 @@ impl Backoff {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(clippy::should_implement_trait)]
|
||||||
pub fn next(&mut self) -> Duration {
|
pub fn next(&mut self) -> Duration {
|
||||||
let next = match self.current {
|
let next = match self.current {
|
||||||
None => self.initial,
|
None => self.initial,
|
||||||
|
|||||||
@@ -359,20 +359,20 @@ async fn reload(reg: &Registry) -> Result<ReloadResult, ApiError> {
|
|||||||
let mut unchanged = Vec::new();
|
let mut unchanged = Vec::new();
|
||||||
|
|
||||||
for name in &existing_names {
|
for name in &existing_names {
|
||||||
if !new_by_name.contains_key(name) {
|
if !new_by_name.contains_key(name)
|
||||||
if let Some(entry) = reg.remove(name).await {
|
&& let Some(entry) = reg.remove(name).await
|
||||||
let (tx, rx) = oneshot::channel();
|
{
|
||||||
|
let (tx, rx) = oneshot::channel();
|
||||||
|
|
||||||
let _ = entry
|
let _ = entry
|
||||||
.handle
|
.handle
|
||||||
.tx
|
.tx
|
||||||
.send(SupervisorCmd::Shutdown { ack: tx })
|
.send(SupervisorCmd::Shutdown { ack: tx })
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
let _ = rx.await;
|
let _ = rx.await;
|
||||||
|
|
||||||
removed.push(name.clone());
|
removed.push(name.clone());
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user