Skip to content

Commit

Permalink
Fix Clippy error and add Clippy CI (#83)
Browse files Browse the repository at this point in the history
Clippy is pretty cool so why not?
  • Loading branch information
Pi-Cla authored May 13, 2024
1 parent 57973e0 commit 1a35a94
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ jobs:
- name: Check formatting
run: |
cargo fmt -- --check
- name: Check clippy
run: |
cargo clippy
- name: Run sample projects to test
run: |
chmod +x runtests.sh
Expand Down
8 changes: 3 additions & 5 deletions bulk-updater/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,12 @@ fn main() -> std::io::Result<()> {
Ok(hasterminfodb) => hasterminfodb.get::<cap::MaxColors>().is_some(),
Err(_) => false,
};
let to_color = matches!(std::io::stdout().is_terminal(), true if {
let coloroption = &args.color;
match coloroption {
let to_color = std::io::stdout().is_terminal()
&& match &args.color {
clap::ColorChoice::Auto => is_termcolorsupported,
clap::ColorChoice::Always => true,
clap::ColorChoice::Never => false,
}
});
};

let filter_layer = EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new("info"));

Expand Down
8 changes: 3 additions & 5 deletions cargo/src/bin/cargo_vendor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,12 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
Err(_) => false,
};

let to_color = matches!(std::io::stdout().is_terminal(), true if {
let coloroption = &args.color;
match coloroption {
let to_color = std::io::stdout().is_terminal()
&& match &args.color {
clap::ColorChoice::Auto => is_termcolorsupported,
clap::ColorChoice::Always => true,
clap::ColorChoice::Never => false,
}
});
};

let filter_layer = EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new("info"));

Expand Down

0 comments on commit 1a35a94

Please sign in to comment.