📎 makes clippy happy

This commit is contained in:
Irevoire 2022-08-12 14:18:27 +02:00
parent e6b806e0cf
commit 83e20027fd
No known key found for this signature in database
GPG key ID: 7A6A970C96104F1B
9 changed files with 15 additions and 13 deletions

View file

@ -22,11 +22,13 @@ pub use store::test::MockStore as Store;
#[cfg(not(test))]
pub use store::Store;
type FilterFn = Box<dyn Fn(&Task) -> bool + Sync + Send + 'static>;
/// Defines constraints to be applied when querying for Tasks from the store.
#[derive(Default)]
pub struct TaskFilter {
indexes: Option<HashSet<String>>,
filter_fn: Option<Box<dyn Fn(&Task) -> bool + Sync + Send + 'static>>,
filter_fn: Option<FilterFn>,
}
impl TaskFilter {
@ -51,8 +53,8 @@ impl TaskFilter {
.insert(index);
}
pub fn filter_fn(&mut self, f: impl Fn(&Task) -> bool + Sync + Send + 'static) {
self.filter_fn.replace(Box::new(f));
pub fn filter_fn(&mut self, f: FilterFn) {
self.filter_fn.replace(f);
}
}

View file

@ -373,7 +373,7 @@ pub mod test {
assert_eq!(tasks.len(), 1);
assert_eq!(
&*tasks.first().as_ref().unwrap().index_uid().unwrap(),
tasks.first().as_ref().unwrap().index_uid().unwrap(),
"test"
);
}