Refactor config.rs and vagrant.rs files (#949)

* Refactor config.rs and vagrant.rs files

* Refactor config.rs and vagrant.rs files
This commit is contained in:
Nils
2024-10-15 11:56:03 +02:00
committed by GitHub
parent 0573fc97c6
commit a5df40e01d
2 changed files with 7 additions and 10 deletions

View File

@@ -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 {

View File

@@ -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"