Skip to content

Commit

Permalink
chore: fix new clippy lints, enforce in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
nyurik committed Feb 1, 2025
1 parent a3f877b commit 75d4f1a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bindgen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
run: cargo fmt -- --check

- name: Run clippy
run: cargo clippy --all-targets --workspace --exclude bindgen-integration --exclude tests_expectations
run: cargo clippy --all-targets --workspace --exclude bindgen-integration --exclude tests_expectations -- -D warnings

msrv:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion bindgen-tests/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub fn main() {

for entry in entries {
// TODO: file_is_cpp() in bindgen/lib.rs checks for hpp,hxx,hh, and h++ - should this be consistent?
if entry.path().extension().map_or(false, |ext| {
if entry.path().extension().is_some_and(|ext| {
ext.eq_ignore_ascii_case("h") || ext.eq_ignore_ascii_case("hpp")
}) {
let func = entry
Expand Down
2 changes: 1 addition & 1 deletion bindgen/ir/dot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ where
if is_allowlisted { "black" } else { "gray" }
)?;
item.dot_attributes(ctx, &mut dot_file)?;
writeln!(&mut dot_file, r#"</table> >];"#)?;
writeln!(&mut dot_file, "</table> >];")?;

item.trace(
ctx,
Expand Down
2 changes: 1 addition & 1 deletion bindgen/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ pub const DEFAULT_ANON_FIELDS_PREFIX: &str = "__bindgen_anon_";
const DEFAULT_NON_EXTERN_FNS_SUFFIX: &str = "__extern";

fn file_is_cpp(name_file: &str) -> bool {
Path::new(name_file).extension().map_or(false, |ext| {
Path::new(name_file).extension().is_some_and(|ext| {
ext.eq_ignore_ascii_case("hpp") ||
ext.eq_ignore_ascii_case("hxx") ||
ext.eq_ignore_ascii_case("hh") ||
Expand Down

0 comments on commit 75d4f1a

Please sign in to comment.