Skip to content

Commit

Permalink
Refactor config.rs and vagrant.rs files (#949)
Browse files Browse the repository at this point in the history
* Refactor config.rs and vagrant.rs files

* Refactor config.rs and vagrant.rs files
  • Loading branch information
niStee authored Oct 15, 2024
1 parent 0573fc9 commit a5df40e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
15 changes: 6 additions & 9 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/steps/remote/vagrant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit a5df40e

Please sign in to comment.