From 836da499f5faa63d60891b03bbe5d1aaa8d39aee Mon Sep 17 00:00:00 2001 From: ungaro Date: Wed, 11 Sep 2024 13:45:02 -0400 Subject: [PATCH] satisfy clippy warnings --- leo/cli/helpers/updater.rs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/leo/cli/helpers/updater.rs b/leo/cli/helpers/updater.rs index b11df2eae6..fa32735bfe 100644 --- a/leo/cli/helpers/updater.rs +++ b/leo/cli/helpers/updater.rs @@ -152,18 +152,16 @@ impl Updater { Ok(false) } } - } else { - if version_file.exists() { - if let Ok(stored_version) = fs::read_to_string(&version_file) { - let current_version = env!("CARGO_PKG_VERSION"); - Ok(bump_is_greater(current_version, &stored_version.trim()).map_err(CliError::self_update_error)?) - } else { - // If we can't read the file, assume no update is available - Ok(false) - } + } else if version_file.exists() { + if let Ok(stored_version) = fs::read_to_string(&version_file) { + let current_version = env!("CARGO_PKG_VERSION"); + Ok(bump_is_greater(current_version, stored_version.trim()).map_err(CliError::self_update_error)?) } else { + // If we can't read the file, assume no update is available Ok(false) } + } else { + Ok(false) } } @@ -184,7 +182,7 @@ impl Updater { let current_time = Self::get_current_time()?; // Write the current time to the last check file. - fs::write(last_check_file, ¤t_time.to_string()).map_err(CliError::cli_io_error)?; + fs::write(last_check_file, current_time.to_string()).map_err(CliError::cli_io_error)?; // Write the latest version to the version file. fs::write(version_file, latest_version).map_err(CliError::cli_io_error)?;