mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-09-12 07:36:29 +00:00
fix clippy warnings
This commit is contained in:
@ -44,12 +44,7 @@ where
|
||||
let store = UpdateStore::open(options, &path, index_handle.clone())?;
|
||||
std::fs::create_dir_all(path.join("update_files"))?;
|
||||
assert!(path.exists());
|
||||
Ok(Self {
|
||||
store,
|
||||
inbox,
|
||||
path,
|
||||
index_handle,
|
||||
})
|
||||
Ok(Self { path, store, inbox, index_handle })
|
||||
}
|
||||
|
||||
pub async fn run(mut self) {
|
||||
|
@ -58,7 +58,7 @@ impl StateLock {
|
||||
fn from_state(state: State) -> Self {
|
||||
let lock = Mutex::new(());
|
||||
let data = ArcSwap::from(Arc::new(state));
|
||||
Self { data, lock }
|
||||
Self { lock, data }
|
||||
}
|
||||
|
||||
fn read(&self) -> Arc<State> {
|
||||
@ -68,10 +68,11 @@ impl StateLock {
|
||||
fn write(&self) -> StateLockGuard {
|
||||
let _lock = self.lock.lock();
|
||||
let state = &self;
|
||||
StateLockGuard { state, _lock }
|
||||
StateLockGuard { _lock, state }
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::large_enum_variant)]
|
||||
pub enum State {
|
||||
Idle,
|
||||
Processing(Uuid, Processing),
|
||||
@ -201,14 +202,7 @@ impl UpdateStore {
|
||||
.try_send(())
|
||||
.expect("Failed to init update store");
|
||||
|
||||
let update_store = Arc::new(UpdateStore {
|
||||
env,
|
||||
notification_sender,
|
||||
next_update_id,
|
||||
pending_queue,
|
||||
updates,
|
||||
state,
|
||||
});
|
||||
let update_store = Arc::new(UpdateStore { env, pending_queue, next_update_id, updates, state, notification_sender });
|
||||
|
||||
// We need a weak reference so we can take ownership on the arc later when we
|
||||
// want to close the index.
|
||||
|
Reference in New Issue
Block a user