mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-22 18:17:39 +08:00
fix clippy warnings
This commit is contained in:
parent
4fe2a13c71
commit
a961f0ce75
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -1,5 +1,7 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 3
|
||||
|
||||
[[package]]
|
||||
name = "actix-codec"
|
||||
version = "0.4.0"
|
||||
|
@ -68,11 +68,7 @@ impl Data {
|
||||
|
||||
api_keys.generate_missing_api_keys();
|
||||
|
||||
let inner = DataInner {
|
||||
index_controller,
|
||||
options,
|
||||
api_keys,
|
||||
};
|
||||
let inner = DataInner { index_controller, api_keys, options };
|
||||
let inner = Arc::new(inner);
|
||||
|
||||
Ok(Data { inner })
|
||||
|
@ -33,11 +33,7 @@ impl<S: IndexStore + Sync + Send> IndexActor<S> {
|
||||
let update_handler = UpdateHandler::new(&options).map_err(IndexError::Error)?;
|
||||
let update_handler = Arc::new(update_handler);
|
||||
let receiver = Some(receiver);
|
||||
Ok(Self {
|
||||
receiver,
|
||||
store,
|
||||
update_handler,
|
||||
})
|
||||
Ok(Self { receiver, update_handler, store })
|
||||
}
|
||||
|
||||
pub async fn run(mut self) {
|
||||
|
@ -44,11 +44,7 @@ impl IndexMeta {
|
||||
let created_at = index.created_at(&txn)?;
|
||||
let updated_at = index.updated_at(&txn)?;
|
||||
let primary_key = index.primary_key(&txn)?.map(String::from);
|
||||
Ok(Self {
|
||||
primary_key,
|
||||
updated_at,
|
||||
created_at,
|
||||
})
|
||||
Ok(Self { created_at, updated_at, primary_key })
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user