From e91f9948160cb00c7945d692e2b312111e320f2e Mon Sep 17 00:00:00 2001 From: curquiza Date: Wed, 21 Dec 2022 11:51:13 +0100 Subject: [PATCH] Make Clippy happy --- dump/src/writer.rs | 4 ++-- index-scheduler/src/batch.rs | 2 +- meili-snap/src/lib.rs | 2 +- meilisearch-auth/src/dump.rs | 2 +- meilisearch-http/src/analytics/mod.rs | 2 +- meilisearch-types/src/versioning.rs | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dump/src/writer.rs b/dump/src/writer.rs index 29aa2508d..587b8e656 100644 --- a/dump/src/writer.rs +++ b/dump/src/writer.rs @@ -25,7 +25,7 @@ impl DumpWriter { if let Some(instance_uuid) = instance_uuid { fs::write( dir.path().join("instance_uid.uuid"), - &instance_uuid.as_hyphenated().to_string(), + instance_uuid.as_hyphenated().to_string(), )?; } @@ -36,7 +36,7 @@ impl DumpWriter { }; fs::write(dir.path().join("metadata.json"), serde_json::to_string(&metadata)?)?; - std::fs::create_dir(&dir.path().join("indexes"))?; + std::fs::create_dir(dir.path().join("indexes"))?; Ok(DumpWriter { dir }) } diff --git a/index-scheduler/src/batch.rs b/index-scheduler/src/batch.rs index 02cfdb178..5100254fd 100644 --- a/index-scheduler/src/batch.rs +++ b/index-scheduler/src/batch.rs @@ -666,7 +666,7 @@ impl IndexScheduler { let snapshot_path = self.snapshots_path.join(format!("{}.snapshot", db_name)); let temp_snapshot_file = tempfile::NamedTempFile::new_in(&self.snapshots_path)?; compression::to_tar_gz(temp_snapshot_dir.path(), temp_snapshot_file.path())?; - let file = temp_snapshot_file.persist(&snapshot_path)?; + let file = temp_snapshot_file.persist(snapshot_path)?; // 5.3 Change the permission to make the snapshot readonly let mut permissions = file.metadata()?.permissions(); diff --git a/meili-snap/src/lib.rs b/meili-snap/src/lib.rs index a2abd0cea..dea0d750b 100644 --- a/meili-snap/src/lib.rs +++ b/meili-snap/src/lib.rs @@ -29,7 +29,7 @@ pub fn default_snapshot_settings_for_test<'a>( let test_name = test_name.strip_suffix("::{{closure}}").unwrap_or(test_name); let test_name = test_name.rsplit("::").next().unwrap().to_owned(); - let path = Path::new("snapshots").join(filename).join(&test_name); + let path = Path::new("snapshots").join(filename).join(test_name); settings.set_snapshot_path(path.clone()); let snap_name = if let Some(name) = name { Cow::Borrowed(name) diff --git a/meilisearch-auth/src/dump.rs b/meilisearch-auth/src/dump.rs index 0b26bf7da..8a215d8ae 100644 --- a/meilisearch-auth/src/dump.rs +++ b/meilisearch-auth/src/dump.rs @@ -18,7 +18,7 @@ impl AuthController { let keys_file_path = dst.as_ref().join(KEYS_PATH); let keys = store.list_api_keys()?; - let mut keys_file = File::create(&keys_file_path)?; + let mut keys_file = File::create(keys_file_path)?; for key in keys { serde_json::to_writer(&mut keys_file, &key)?; keys_file.write_all(b"\n")?; diff --git a/meilisearch-http/src/analytics/mod.rs b/meilisearch-http/src/analytics/mod.rs index 46c4b2090..1effe6692 100644 --- a/meilisearch-http/src/analytics/mod.rs +++ b/meilisearch-http/src/analytics/mod.rs @@ -51,7 +51,7 @@ fn config_user_id_path(db_path: &Path) -> Option { fn find_user_id(db_path: &Path) -> Option { fs::read_to_string(db_path.join("instance-uid")) .ok() - .or_else(|| fs::read_to_string(&config_user_id_path(db_path)?).ok()) + .or_else(|| fs::read_to_string(config_user_id_path(db_path)?).ok()) .and_then(|uid| InstanceUid::from_str(&uid).ok()) } diff --git a/meilisearch-types/src/versioning.rs b/meilisearch-types/src/versioning.rs index bf1efe1ad..f0979f669 100644 --- a/meilisearch-types/src/versioning.rs +++ b/meilisearch-types/src/versioning.rs @@ -19,7 +19,7 @@ pub fn create_version_file(db_path: &Path) -> io::Result<()> { pub fn check_version_file(db_path: &Path) -> anyhow::Result<()> { let version_path = db_path.join(VERSION_FILE_NAME); - match fs::read_to_string(&version_path) { + match fs::read_to_string(version_path) { Ok(version) => { let version_components = version.split('.').collect::>(); let (major, minor, patch) = match &version_components[..] {