mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-22 21:04:27 +01: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.
|
# This file is automatically @generated by Cargo.
|
||||||
# It is not intended for manual editing.
|
# It is not intended for manual editing.
|
||||||
|
version = 3
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "actix-codec"
|
name = "actix-codec"
|
||||||
version = "0.4.0"
|
version = "0.4.0"
|
||||||
|
@ -68,11 +68,7 @@ impl Data {
|
|||||||
|
|
||||||
api_keys.generate_missing_api_keys();
|
api_keys.generate_missing_api_keys();
|
||||||
|
|
||||||
let inner = DataInner {
|
let inner = DataInner { index_controller, api_keys, options };
|
||||||
index_controller,
|
|
||||||
options,
|
|
||||||
api_keys,
|
|
||||||
};
|
|
||||||
let inner = Arc::new(inner);
|
let inner = Arc::new(inner);
|
||||||
|
|
||||||
Ok(Data { 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 = UpdateHandler::new(&options).map_err(IndexError::Error)?;
|
||||||
let update_handler = Arc::new(update_handler);
|
let update_handler = Arc::new(update_handler);
|
||||||
let receiver = Some(receiver);
|
let receiver = Some(receiver);
|
||||||
Ok(Self {
|
Ok(Self { receiver, update_handler, store })
|
||||||
receiver,
|
|
||||||
store,
|
|
||||||
update_handler,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn run(mut self) {
|
pub async fn run(mut self) {
|
||||||
|
@ -44,11 +44,7 @@ impl IndexMeta {
|
|||||||
let created_at = index.created_at(&txn)?;
|
let created_at = index.created_at(&txn)?;
|
||||||
let updated_at = index.updated_at(&txn)?;
|
let updated_at = index.updated_at(&txn)?;
|
||||||
let primary_key = index.primary_key(&txn)?.map(String::from);
|
let primary_key = index.primary_key(&txn)?.map(String::from);
|
||||||
Ok(Self {
|
Ok(Self { created_at, updated_at, primary_key })
|
||||||
primary_key,
|
|
||||||
updated_at,
|
|
||||||
created_at,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,12 +44,7 @@ where
|
|||||||
let store = UpdateStore::open(options, &path, index_handle.clone())?;
|
let store = UpdateStore::open(options, &path, index_handle.clone())?;
|
||||||
std::fs::create_dir_all(path.join("update_files"))?;
|
std::fs::create_dir_all(path.join("update_files"))?;
|
||||||
assert!(path.exists());
|
assert!(path.exists());
|
||||||
Ok(Self {
|
Ok(Self { path, store, inbox, index_handle })
|
||||||
store,
|
|
||||||
inbox,
|
|
||||||
path,
|
|
||||||
index_handle,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn run(mut self) {
|
pub async fn run(mut self) {
|
||||||
|
@ -58,7 +58,7 @@ impl StateLock {
|
|||||||
fn from_state(state: State) -> Self {
|
fn from_state(state: State) -> Self {
|
||||||
let lock = Mutex::new(());
|
let lock = Mutex::new(());
|
||||||
let data = ArcSwap::from(Arc::new(state));
|
let data = ArcSwap::from(Arc::new(state));
|
||||||
Self { data, lock }
|
Self { lock, data }
|
||||||
}
|
}
|
||||||
|
|
||||||
fn read(&self) -> Arc<State> {
|
fn read(&self) -> Arc<State> {
|
||||||
@ -68,10 +68,11 @@ impl StateLock {
|
|||||||
fn write(&self) -> StateLockGuard {
|
fn write(&self) -> StateLockGuard {
|
||||||
let _lock = self.lock.lock();
|
let _lock = self.lock.lock();
|
||||||
let state = &self;
|
let state = &self;
|
||||||
StateLockGuard { state, _lock }
|
StateLockGuard { _lock, state }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(clippy::large_enum_variant)]
|
||||||
pub enum State {
|
pub enum State {
|
||||||
Idle,
|
Idle,
|
||||||
Processing(Uuid, Processing),
|
Processing(Uuid, Processing),
|
||||||
@ -201,14 +202,7 @@ impl UpdateStore {
|
|||||||
.try_send(())
|
.try_send(())
|
||||||
.expect("Failed to init update store");
|
.expect("Failed to init update store");
|
||||||
|
|
||||||
let update_store = Arc::new(UpdateStore {
|
let update_store = Arc::new(UpdateStore { env, pending_queue, next_update_id, updates, state, notification_sender });
|
||||||
env,
|
|
||||||
notification_sender,
|
|
||||||
next_update_id,
|
|
||||||
pending_queue,
|
|
||||||
updates,
|
|
||||||
state,
|
|
||||||
});
|
|
||||||
|
|
||||||
// We need a weak reference so we can take ownership on the arc later when we
|
// We need a weak reference so we can take ownership on the arc later when we
|
||||||
// want to close the index.
|
// want to close the index.
|
||||||
|
Loading…
Reference in New Issue
Block a user