Skip to content

Commit c00706e

Browse files
committed
chore: fix new clippy lints, enforce in CI
1 parent a3f877b commit c00706e

File tree

4 files changed

+4
-12
lines changed

4 files changed

+4
-12
lines changed

.github/workflows/bindgen.yml

+1-9
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,11 @@ jobs:
1818
steps:
1919
- uses: actions/checkout@v4
2020

21-
- name: Install stable
22-
uses: dtolnay/rust-toolchain@master
23-
with:
24-
# TODO: Should ideally be stable, but we use some nightly-only
25-
# features.
26-
toolchain: nightly
27-
components: rustfmt, clippy
28-
2921
- name: Run rustfmt
3022
run: cargo fmt -- --check
3123

3224
- name: Run clippy
33-
run: cargo clippy --all-targets --workspace --exclude bindgen-integration --exclude tests_expectations
25+
run: cargo clippy --all-targets --workspace --exclude bindgen-integration --exclude tests_expectations -- -D warnings
3426

3527
msrv:
3628
runs-on: ubuntu-latest

bindgen-tests/build.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub fn main() {
2323

2424
for entry in entries {
2525
// TODO: file_is_cpp() in bindgen/lib.rs checks for hpp,hxx,hh, and h++ - should this be consistent?
26-
if entry.path().extension().map_or(false, |ext| {
26+
if entry.path().extension().is_some_and(|ext| {
2727
ext.eq_ignore_ascii_case("h") || ext.eq_ignore_ascii_case("hpp")
2828
}) {
2929
let func = entry

bindgen/ir/dot.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ where
4141
if is_allowlisted { "black" } else { "gray" }
4242
)?;
4343
item.dot_attributes(ctx, &mut dot_file)?;
44-
writeln!(&mut dot_file, r#"</table> >];"#)?;
44+
writeln!(&mut dot_file, "</table> >];")?;
4545

4646
item.trace(
4747
ctx,

bindgen/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ pub const DEFAULT_ANON_FIELDS_PREFIX: &str = "__bindgen_anon_";
8686
const DEFAULT_NON_EXTERN_FNS_SUFFIX: &str = "__extern";
8787

8888
fn file_is_cpp(name_file: &str) -> bool {
89-
Path::new(name_file).extension().map_or(false, |ext| {
89+
Path::new(name_file).extension().is_some_and(|ext| {
9090
ext.eq_ignore_ascii_case("hpp") ||
9191
ext.eq_ignore_ascii_case("hxx") ||
9292
ext.eq_ignore_ascii_case("hh") ||

0 commit comments

Comments
 (0)