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:
@@ -1566,12 +1566,11 @@ impl Config {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn enable_pipupgrade(&self) -> bool {
|
pub fn enable_pipupgrade(&self) -> bool {
|
||||||
return self
|
self.config_file
|
||||||
.config_file
|
|
||||||
.python
|
.python
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.and_then(|python| python.enable_pipupgrade)
|
.and_then(|python| python.enable_pipupgrade)
|
||||||
.unwrap_or(false);
|
.unwrap_or(false)
|
||||||
}
|
}
|
||||||
pub fn pipupgrade_arguments(&self) -> &str {
|
pub fn pipupgrade_arguments(&self) -> &str {
|
||||||
self.config_file
|
self.config_file
|
||||||
@@ -1581,20 +1580,18 @@ impl Config {
|
|||||||
.unwrap_or("")
|
.unwrap_or("")
|
||||||
}
|
}
|
||||||
pub fn enable_pip_review(&self) -> bool {
|
pub fn enable_pip_review(&self) -> bool {
|
||||||
return self
|
self.config_file
|
||||||
.config_file
|
|
||||||
.python
|
.python
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.and_then(|python| python.enable_pip_review)
|
.and_then(|python| python.enable_pip_review)
|
||||||
.unwrap_or(false);
|
.unwrap_or(false)
|
||||||
}
|
}
|
||||||
pub fn enable_pip_review_local(&self) -> bool {
|
pub fn enable_pip_review_local(&self) -> bool {
|
||||||
return self
|
self.config_file
|
||||||
.config_file
|
|
||||||
.python
|
.python
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.and_then(|python| python.enable_pip_review_local)
|
.and_then(|python| python.enable_pip_review_local)
|
||||||
.unwrap_or(false);
|
.unwrap_or(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn display_time(&self) -> bool {
|
pub fn display_time(&self) -> bool {
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ impl<'a> TemporaryPowerOn<'a> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> Drop for TemporaryPowerOn<'a> {
|
impl Drop for TemporaryPowerOn<'_> {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
let subcommand = if self.ctx.config().vagrant_always_suspend().unwrap_or(false) {
|
let subcommand = if self.ctx.config().vagrant_always_suspend().unwrap_or(false) {
|
||||||
"suspend"
|
"suspend"
|
||||||
|
|||||||
Reference in New Issue
Block a user