mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
fix(desktop): extract ObserverFn type alias to appease clippy::type_complexity
The thread_local OBSERVER field had an inline complex type that triggered -D clippy::type_complexity on the push hook. Extract it to a type alias. Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
This commit is contained in:
@@ -360,8 +360,10 @@ pub(crate) async fn scoped_archive_operation(
|
||||
pub(crate) mod test_hooks {
|
||||
use std::{cell::RefCell, sync::Arc};
|
||||
|
||||
type ObserverFn = Arc<dyn Fn(&nostr::Event) + Send + Sync>;
|
||||
|
||||
thread_local! {
|
||||
static OBSERVER: RefCell<Option<Arc<dyn Fn(&nostr::Event) + Send + Sync>>> =
|
||||
static OBSERVER: RefCell<Option<ObserverFn>> =
|
||||
const { RefCell::new(None) };
|
||||
static ATTEMPT_COUNT: RefCell<u32> = const { RefCell::new(0) };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user