From a5df40e01d55e70cbc7233de36fae94ab714c0c3 Mon Sep 17 00:00:00 2001 From: Nils <52573120+niStee@users.noreply.github.com> Date: Tue, 15 Oct 2024 11:56:03 +0200 Subject: [PATCH] Refactor config.rs and vagrant.rs files (#949) * Refactor config.rs and vagrant.rs files * Refactor config.rs and vagrant.rs files --- src/config.rs | 15 ++++++--------- src/steps/remote/vagrant.rs | 2 +- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/config.rs b/src/config.rs index 69842617..0991e284 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1566,12 +1566,11 @@ impl Config { } pub fn enable_pipupgrade(&self) -> bool { - return self - .config_file + self.config_file .python .as_ref() .and_then(|python| python.enable_pipupgrade) - .unwrap_or(false); + .unwrap_or(false) } pub fn pipupgrade_arguments(&self) -> &str { self.config_file @@ -1581,20 +1580,18 @@ impl Config { .unwrap_or("") } pub fn enable_pip_review(&self) -> bool { - return self - .config_file + self.config_file .python .as_ref() .and_then(|python| python.enable_pip_review) - .unwrap_or(false); + .unwrap_or(false) } pub fn enable_pip_review_local(&self) -> bool { - return self - .config_file + self.config_file .python .as_ref() .and_then(|python| python.enable_pip_review_local) - .unwrap_or(false); + .unwrap_or(false) } pub fn display_time(&self) -> bool { diff --git a/src/steps/remote/vagrant.rs b/src/steps/remote/vagrant.rs index f3c2397d..64d62255 100644 --- a/src/steps/remote/vagrant.rs +++ b/src/steps/remote/vagrant.rs @@ -126,7 +126,7 @@ impl<'a> TemporaryPowerOn<'a> { } } -impl<'a> Drop for TemporaryPowerOn<'a> { +impl Drop for TemporaryPowerOn<'_> { fn drop(&mut self) { let subcommand = if self.ctx.config().vagrant_always_suspend().unwrap_or(false) { "suspend"