From 750e7382c67e062d92a7db40716d864e2ef966db Mon Sep 17 00:00:00 2001 From: Takayuki Maeda <41065217+TaKO8Ki@users.noreply.github.com> Date: Wed, 29 Jul 2020 11:32:34 +0900 Subject: [PATCH] fix clippy warnings --- meilisearch-core/src/database.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meilisearch-core/src/database.rs b/meilisearch-core/src/database.rs index f7ede3552..5f4efef96 100644 --- a/meilisearch-core/src/database.rs +++ b/meilisearch-core/src/database.rs @@ -182,7 +182,7 @@ fn version_guard(path: &Path, create: bool) -> MResult<()> { let version = re .captures_iter(&version) .next() - .ok_or(Error::VersionMismatch("bad VERSION file".to_string()))?; + .ok_or_else(|| Error::VersionMismatch("bad VERSION file".to_string()))?; // the first is always the complete match, safe to unwrap because we have a match let version_major = version.get(1).unwrap().as_str(); let version_minor = version.get(2).unwrap().as_str(); @@ -205,7 +205,7 @@ fn version_guard(path: &Path, create: bool) -> MResult<()> { } else { // when no version file is found and we were not told to create one, this // means that the version is inferior to the one this feature was added in. - return Err(Error::VersionMismatch(format!("<0.12.0"))); + return Err(Error::VersionMismatch("<0.12.0".to_string())); } } _ => return Err(error.into())