Skip to content

Commit

Permalink
chore: Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinblackman committed Jul 5, 2024
1 parent 7281bbb commit 47f912e
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 8 deletions.
7 changes: 7 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ readme = "README.md"
repository = "https://github.com/dustinblackman/cargo-run-bin"
rust-version = "1.70.0"
description = "Build, cache, and run binaries scoped in Cargo.toml rather than installing globally. This acts similarly to npm run and gomodrun, and allows your teams to always be running the same tooling versions."
exclude = [
".cargo-husky",
"tests",
"cliff.toml",
"deny.toml",
"rust-toolchain.toml"
]

[[bin]]
name = "cargo-bin"
Expand Down
4 changes: 2 additions & 2 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ fn install_all_binaries() -> Result<()> {
binary::install(binary_package)?;
}

println!("\x1b[32m{}\x1b[0m", "Done!");
println!("\x1b[32mDone!\x1b[0m");
return Ok(());
}

fn sync_aliases() -> Result<()> {
cargo_config::sync_aliases()?;
println!("\x1b[32m{}\x1b[0m", "Done!");
println!("\x1b[32mDone!\x1b[0m");
return Ok(());
}

Expand Down
2 changes: 1 addition & 1 deletion src/shims.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fn create_shim(binary: &str, bin_path: path::PathBuf) -> Result<()> {
.unwrap()
.to_string();

if !vec!["bash", "zsh", "sh"].contains(&&*shell) {
if !["bash", "zsh", "sh"].contains(&&*shell) {
shell = "sh".to_string();
}

Expand Down
2 changes: 1 addition & 1 deletion tests/cargo_config_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ mod sync_aliases {
assert!(res.is_ok());
assert!(toml_str.contains("nextest = [\"bin\", \"cargo-nextest\"]"));
}
}
}
10 changes: 6 additions & 4 deletions tests/shims_test.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use anyhow::Result;
use std::fs;

use anyhow::Result;
use cargo_run_bin::metadata;

fn clean_shims() -> Result<()> {
Expand All @@ -8,13 +9,15 @@ fn clean_shims() -> Result<()> {
fs::remove_dir_all(&bin_dir)?;
}

return Ok(());
Ok(())
}

mod sync_shims {
use std::fs;
use cargo_run_bin::shims::sync;

use cargo_run_bin::metadata;
use cargo_run_bin::shims::sync;

use super::clean_shims;

#[test]
Expand Down Expand Up @@ -68,7 +71,6 @@ mod sync_shims {
assert!(content.starts_with("#!/usr/bin/env sh"));
}


#[test]
#[cfg(not(target_family = "unix"))]
fn it_creates_shims() {
Expand Down

0 comments on commit 47f912e

Please sign in to comment.