Remove redundant dereferences
This commit is contained in:
@@ -620,8 +620,7 @@ impl Config {
|
|||||||
/// Extra trizen arguments
|
/// Extra trizen arguments
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
pub fn trizen_arguments(&self) -> &str {
|
pub fn trizen_arguments(&self) -> &str {
|
||||||
&self
|
self.config_file
|
||||||
.config_file
|
|
||||||
.linux
|
.linux
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.and_then(|s| s.trizen_arguments.as_deref())
|
.and_then(|s| s.trizen_arguments.as_deref())
|
||||||
|
|||||||
@@ -35,18 +35,18 @@ impl<'a> ExecutionContext<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn git(&self) -> &Git {
|
pub fn git(&self) -> &Git {
|
||||||
&self.git
|
self.git
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn sudo(&self) -> &Option<PathBuf> {
|
pub fn sudo(&self) -> &Option<PathBuf> {
|
||||||
&self.sudo
|
self.sudo
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn config(&self) -> &Config {
|
pub fn config(&self) -> &Config {
|
||||||
&self.config
|
self.config
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn base_dirs(&self) -> &BaseDirs {
|
pub fn base_dirs(&self) -> &BaseDirs {
|
||||||
&self.base_dirs
|
self.base_dirs
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ pub fn run_micro(run_type: RunType) -> Result<()> {
|
|||||||
print_separator("micro");
|
print_separator("micro");
|
||||||
|
|
||||||
let stdout = run_type.execute(µ).args(&["-plugin", "update"]).string_output()?;
|
let stdout = run_type.execute(µ).args(&["-plugin", "update"]).string_output()?;
|
||||||
std::io::stdout().write_all(&stdout.as_bytes())?;
|
std::io::stdout().write_all(stdout.as_bytes())?;
|
||||||
|
|
||||||
if stdout.contains("Nothing to install / update") || stdout.contains("One or more plugins installed") {
|
if stdout.contains("Nothing to install / update") || stdout.contains("One or more plugins installed") {
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ async fn pull_repository(repo: String, git: &Path, ctx: &ExecutionContext<'_>) -
|
|||||||
println!("{} pulling {}", style("Failed").red().bold(), &repo);
|
println!("{} pulling {}", style("Failed").red().bold(), &repo);
|
||||||
print!("{}", message);
|
print!("{}", message);
|
||||||
} else {
|
} else {
|
||||||
let after_revision = get_head_revision(&git, &repo);
|
let after_revision = get_head_revision(git, &repo);
|
||||||
|
|
||||||
match (&before_revision, &after_revision) {
|
match (&before_revision, &after_revision) {
|
||||||
(Some(before), Some(after)) if before != after => {
|
(Some(before), Some(after)) if before != after => {
|
||||||
@@ -219,7 +219,7 @@ impl Git {
|
|||||||
}
|
}
|
||||||
_ => true, // repo has remotes or command to check for remotes has failed. proceed to pull anyway.
|
_ => true, // repo has remotes or command to check for remotes has failed. proceed to pull anyway.
|
||||||
})
|
})
|
||||||
.map(|repo| pull_repository(repo.clone(), &git, ctx));
|
.map(|repo| pull_repository(repo.clone(), git, ctx));
|
||||||
|
|
||||||
let stream_of_futures = if let Some(limit) = ctx.config().git_concurrency_limit() {
|
let stream_of_futures = if let Some(limit) = ctx.config().git_concurrency_limit() {
|
||||||
iter(futures_iterator).buffer_unordered(limit).boxed()
|
iter(futures_iterator).buffer_unordered(limit).boxed()
|
||||||
@@ -267,7 +267,7 @@ impl<'a> Repositories<'a> {
|
|||||||
match entry {
|
match entry {
|
||||||
Ok(path) => {
|
Ok(path) => {
|
||||||
if let Some(last_git_repo) = &last_git_repo {
|
if let Some(last_git_repo) = &last_git_repo {
|
||||||
if path.is_descendant_of(&last_git_repo) {
|
if path.is_descendant_of(last_git_repo) {
|
||||||
debug!(
|
debug!(
|
||||||
"Skipping {} because it's a decendant of last known repo {}",
|
"Skipping {} because it's a decendant of last known repo {}",
|
||||||
path.display(),
|
path.display(),
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ pub fn topgrade_vagrant_box(ctx: &ExecutionContext, vagrant_box: &VagrantBox) ->
|
|||||||
return Err(SkipStep(format!("Skipping powered off box {}", vagrant_box)).into());
|
return Err(SkipStep(format!("Skipping powered off box {}", vagrant_box)).into());
|
||||||
} else {
|
} else {
|
||||||
print_separator(seperator);
|
print_separator(seperator);
|
||||||
_poweron = Some(vagrant.temporary_power_on(&vagrant_box, ctx)?);
|
_poweron = Some(vagrant.temporary_power_on(vagrant_box, ctx)?);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print_separator(seperator);
|
print_separator(seperator);
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ pub fn run_in_tmux(args: &Option<String>) -> ! {
|
|||||||
pub fn run_command(ctx: &ExecutionContext, command: &str) -> Result<()> {
|
pub fn run_command(ctx: &ExecutionContext, command: &str) -> Result<()> {
|
||||||
Tmux::new(ctx.config().tmux_arguments())
|
Tmux::new(ctx.config().tmux_arguments())
|
||||||
.build()
|
.build()
|
||||||
.args(&["new-window", "-a", "-t", "topgrade:1", &command])
|
.args(&["new-window", "-a", "-t", "topgrade:1", command])
|
||||||
.env_remove("TMUX")
|
.env_remove("TMUX")
|
||||||
.spawn()?
|
.spawn()?
|
||||||
.wait()?
|
.wait()?
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ pub fn upgrade_vim(base_dirs: &BaseDirs, ctx: &ExecutionContext) -> Result<()> {
|
|||||||
return Err(SkipStep(String::from("vim binary might by actually nvim")).into());
|
return Err(SkipStep(String::from("vim binary might by actually nvim")).into());
|
||||||
}
|
}
|
||||||
|
|
||||||
let vimrc = vimrc(&base_dirs)?;
|
let vimrc = vimrc(base_dirs)?;
|
||||||
|
|
||||||
print_separator("Vim");
|
print_separator("Vim");
|
||||||
upgrade(&vim, &vimrc, ctx)
|
upgrade(&vim, &vimrc, ctx)
|
||||||
@@ -88,7 +88,7 @@ pub fn upgrade_vim(base_dirs: &BaseDirs, ctx: &ExecutionContext) -> Result<()> {
|
|||||||
|
|
||||||
pub fn upgrade_neovim(base_dirs: &BaseDirs, ctx: &ExecutionContext) -> Result<()> {
|
pub fn upgrade_neovim(base_dirs: &BaseDirs, ctx: &ExecutionContext) -> Result<()> {
|
||||||
let nvim = require("nvim")?;
|
let nvim = require("nvim")?;
|
||||||
let nvimrc = nvimrc(&base_dirs)?;
|
let nvimrc = nvimrc(base_dirs)?;
|
||||||
|
|
||||||
print_separator("Neovim");
|
print_separator("Neovim");
|
||||||
upgrade(&nvim, &nvimrc, ctx)
|
upgrade(&nvim, &nvimrc, ctx)
|
||||||
|
|||||||
Reference in New Issue
Block a user