mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
Make clippy happy
This commit is contained in:
parent
3fda1942c0
commit
373995dca9
7 changed files with 31 additions and 30 deletions
|
@ -72,8 +72,8 @@ impl IndexMapper {
|
|||
pub fn index(&self, rtxn: &RoTxn, name: &str) -> Result<Index> {
|
||||
let uuid = self
|
||||
.index_mapping
|
||||
.get(&rtxn, name)?
|
||||
.ok_or(Error::IndexNotFound(name.to_string()))?;
|
||||
.get(rtxn, name)?
|
||||
.ok_or_else(|| Error::IndexNotFound(name.to_string()))?;
|
||||
|
||||
// we clone here to drop the lock before entering the match
|
||||
let index = self.index_map.read().unwrap().get(&uuid).cloned();
|
||||
|
@ -109,7 +109,7 @@ impl IndexMapper {
|
|||
|
||||
pub fn indexes(&self, rtxn: &RoTxn) -> Result<Vec<Index>> {
|
||||
self.index_mapping
|
||||
.iter(&rtxn)?
|
||||
.iter(rtxn)?
|
||||
.map(|ret| {
|
||||
ret.map_err(Error::from)
|
||||
.and_then(|(name, _)| self.index(rtxn, name))
|
||||
|
@ -122,11 +122,11 @@ impl IndexMapper {
|
|||
let lhs_uuid = self
|
||||
.index_mapping
|
||||
.get(wtxn, lhs)?
|
||||
.ok_or(Error::IndexNotFound(lhs.to_string()))?;
|
||||
.ok_or_else(|| Error::IndexNotFound(lhs.to_string()))?;
|
||||
let rhs_uuid = self
|
||||
.index_mapping
|
||||
.get(wtxn, rhs)?
|
||||
.ok_or(Error::IndexNotFound(rhs.to_string()))?;
|
||||
.ok_or_else(|| Error::IndexNotFound(rhs.to_string()))?;
|
||||
|
||||
self.index_mapping.put(wtxn, lhs, &rhs_uuid)?;
|
||||
self.index_mapping.put(wtxn, rhs, &lhs_uuid)?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue