fix clippy::ref_option

fix needless borrow

fix clippy::nonminimal_bool
This commit is contained in:
Jason Volk committed 2024-10-27 02:11:07 +00:00
1 parent 5e6dbaa27f
commit 9787dfe77c
11 files changed
+24 -30

No files matched your search

+2 -2
View File
@@ -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;
}
}