Skip to content

Commit

Permalink
Make Clippy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
smoelius committed Dec 1, 2024
1 parent acc570b commit a895e68
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cargo-dylint/tests/ci.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ fn duplicate_dependencies() {
let stdout_actual = std::str::from_utf8(&assert.get_output().stdout).unwrap();
let package_versions = stdout_actual
.lines()
.filter(|line| line.chars().next().map_or(false, char::is_alphabetic))
.filter(|line| line.chars().next().is_some_and(char::is_alphabetic))
.map(|line| {
<[_; 2]>::try_from(line.split_ascii_whitespace().take(2).collect::<Vec<_>>())
.unwrap()
Expand Down
2 changes: 1 addition & 1 deletion dylint/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fn write_dylint_driver_manifest_dir() {
let dylint_driver_manifest_dir = if dylint_manifest_dir.starts_with(cargo_home)
|| dylint_manifest_dir
.parent()
.map_or(false, |path| path.ends_with("target/package"))
.is_some_and(|path| path.ends_with("target/package"))
|| env::var(env::DOCS_RS).is_ok()
{
"None".to_owned()
Expand Down
2 changes: 1 addition & 1 deletion internal/src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ declare_const!(TARGET);
/// ```
#[must_use]
pub fn enabled(key: &str) -> bool {
std::env::var(key).map_or(false, |value| value != "0")
std::env::var(key).is_ok_and(|value| value != "0")
}

/// A wrapper around `std::env::var` that converts the error into an `anyhow::Error`.
Expand Down
2 changes: 1 addition & 1 deletion utils/testing/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ fn rustc_flags(metadata: &Metadata, package: &Package, target: &Target) -> Resul
.split(' ')
.map(ToOwned::to_owned)
.collect::<Vec<_>>();
if args.first().map_or(false, is_rustc)
if args.first().is_some_and(is_rustc)
&& args
.as_slice()
.windows(2)
Expand Down

0 comments on commit a895e68

Please sign in to comment.