mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 12:27:13 +02:00
📎 makes clippy happy
This commit is contained in:
parent
e6b806e0cf
commit
83e20027fd
9 changed files with 15 additions and 13 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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"
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue