Make clippy happy

This commit is contained in:
Roey Darwish Dror
2019-09-28 15:13:01 +03:00
parent cfce9775df
commit e548cb4059
6 changed files with 32 additions and 32 deletions

View File

@@ -123,7 +123,7 @@ pub fn run_composer_update(base_dirs: &BaseDirs, run_type: RunType) -> Result<()
.and_then(PathExt::require)?;
if !composer_home.is_descendant_of(base_dirs.home_dir()) {
Err(ErrorKind::SkipStep)?;
return Err(ErrorKind::SkipStep.into());
}
print_separator("Composer");
@@ -149,9 +149,10 @@ pub fn run_remote_topgrade(
#[cfg(unix)]
{
crate::tmux::run_remote_topgrade(hostname, &ssh)?;
Err(ErrorKind::SkipStep)?
Err(ErrorKind::SkipStep.into())
}
#[cfg(not(unix))]
unreachable!("Tmux execution is only implemented in Unix");
} else {
let mut args = vec!["-t", hostname];

View File

@@ -121,29 +121,28 @@ impl Git {
if output.status.success() {
let after_revision = get_head_revision(&cloned_git, &repo);
if before_revision != after_revision
&& after_revision.is_some()
&& before_revision.is_some()
{
println!("{} {}:", style("Changed").yellow().bold(), path);
Command::new(&cloned_git)
.current_dir(&repo)
.args(&[
"--no-pager",
"log",
"--no-decorate",
"--oneline",
&format!("{}..{}", before_revision.unwrap(), after_revision.unwrap()),
])
.spawn()
.unwrap()
.wait()
.unwrap();
println!();
} else {
println!("{} {}", style("Up-to-date").green().bold(), path);
match (&before_revision, &after_revision) {
(Some(before), Some(after)) if before != after => {
println!("{} {}:", style("Changed").yellow().bold(), path);
Command::new(&cloned_git)
.current_dir(&repo)
.args(&[
"--no-pager",
"log",
"--no-decorate",
"--oneline",
&format!("{}..{}", before, after),
])
.spawn()
.unwrap()
.wait()
.unwrap();
println!();
}
_ => {
println!("{} {}", style("Up-to-date").green().bold(), path);
}
}
Ok(true) as Result<bool, Error>
} else {
println!("{} pulling {}", style("Failed").red().bold(), path);

View File

@@ -33,7 +33,7 @@ pub fn run_npm_upgrade(base_dirs: &BaseDirs, run_type: RunType) -> Result<(), Er
let npm = require("npm").map(NPM::new)?;
let npm_root = npm.root()?;
if !npm_root.is_descendant_of(base_dirs.home_dir()) {
Err(ErrorKind::SkipStep)?;
return Err(ErrorKind::SkipStep.into());
}
print_separator("Node Package Manager");

View File

@@ -83,7 +83,7 @@ fn upgrade(vim: &PathBuf, vimrc: &PathBuf, plugin_framework: PluginFramework, ru
if !status.success() {
io::stdout().write(&output.stdout).ok();
io::stderr().write(&output.stderr).ok();
Err(ErrorKind::ProcessFailed(status))?
return Err(ErrorKind::ProcessFailed(status).into());
} else {
println!("Plugins upgraded")
}
@@ -98,7 +98,7 @@ pub fn upgrade_vim(base_dirs: &BaseDirs, run_type: RunType) -> Result<(), Error>
let output = Command::new(&vim).arg("--version").check_output()?;
if !output.starts_with("VIM") {
Err(ErrorKind::SkipStep)?;
return Err(ErrorKind::SkipStep.into());
}
let vimrc = require_option(vimrc(&base_dirs))?;