fix clippy::ref_option
fix needless borrow fix clippy::nonminimal_bool
This commit is contained in:
parent
5e6dbaa27f
commit
9787dfe77c
11 changed files with 24 additions and 30 deletions
|
@ -370,9 +370,9 @@ impl Service {
|
|||
|
||||
/// Sets the self-reference to crate::Services which will provide context to
|
||||
/// the admin commands.
|
||||
pub(super) fn set_services(&self, services: &Option<Arc<crate::Services>>) {
|
||||
pub(super) fn set_services(&self, services: Option<&Arc<crate::Services>>) {
|
||||
let receiver = &mut *self.services.services.write().expect("locked for writing");
|
||||
let weak = services.as_ref().map(Arc::downgrade);
|
||||
let weak = services.map(Arc::downgrade);
|
||||
*receiver = weak;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue