diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 806f6df2..dac38885 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -2,16 +2,18 @@ 2. [ ] Make sure that the changes are covered by unit-tests. -3. [ ] Run `cargo +nightly fmt` on the changes. +3. [ ] Run `cargo clippy` on the changes. -4. [ ] Please put changelog entries **in the description of this Pull Request** +4. [ ] Run `cargo +nightly fmt` on the changes. + +5. [ ] Please put changelog entries **in the description of this Pull Request** if knowledge of this change could be valuable to users. No need to put the entries to the changelog directly, they will be transferred to the changelog file by maintainers right after the Pull Request merge. Please remove any items from the template below that are not applicable. -5. [ ] Describe in common words what is the purpose of this change, related +6. [ ] Describe in common words what is the purpose of this change, related Github Issues, and highlight important implementation aspects. Changelog: diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 95788b10..061403a2 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -51,11 +51,19 @@ jobs: run: | cd examples cargo build --verbose + clippy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Run clippy check + run: | + rustup component add clippy + cargo clippy -- -Dwarnings fmt: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Check formatting + - name: Run fmt check run: | rustup toolchain install nightly --component rustfmt cargo +nightly fmt --check diff --git a/vulkano/autogen/extensions.rs b/vulkano/autogen/extensions.rs index 9563fb23..8cf93318 100644 --- a/vulkano/autogen/extensions.rs +++ b/vulkano/autogen/extensions.rs @@ -254,11 +254,16 @@ fn device_extensions_output(members: &[ExtensionsMember]) -> TokenStream { } } }, - ); + ) + .collect::>(); - quote! { - if self.#name { - #(#requires_all_of_items)* + if requires_all_of_items.is_empty() { + quote! {} + } else { + quote! { + if self.#name { + #(#requires_all_of_items)* + } } } },