From f5229d3fb1ce2d4a861af217d6e611f6ed7b473b Mon Sep 17 00:00:00 2001 From: Kai Hudalla Date: Wed, 15 Jan 2025 11:45:29 +0100 Subject: [PATCH 1/2] Fix Clippy warning --- src/local_transport.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/local_transport.rs b/src/local_transport.rs index 385ae4a..fcea8cd 100644 --- a/src/local_transport.rs +++ b/src/local_transport.rs @@ -36,7 +36,7 @@ impl RegisteredListener { } if let Some(pattern) = &self.sink_filter { - sink.map_or(false, |candidate_sink| pattern.matches(candidate_sink)) + sink.is_some_and(|candidate_sink| pattern.matches(candidate_sink)) } else { sink.is_none() } From 3b0252d5306126e6ba8a50b5d347c0735c7a8ed5 Mon Sep 17 00:00:00 2001 From: Kai Hudalla Date: Thu, 16 Jan 2025 09:44:11 +0100 Subject: [PATCH 2/2] Improve CI jobs for checking/linting code --- .github/workflows/check.yaml | 6 +++--- tools/fmt_clippy_doc.sh | 13 ++++++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index df05dbe..42f2f39 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -70,7 +70,7 @@ jobs: toolchain: ${{ env.RUST_TOOLCHAIN }} - name: Run cargo check run: | - cargo check --all --tests + cargo check --workspace --all-targets --all-features # [impl->req~up-language-ci-linter~1] fmt: @@ -85,7 +85,7 @@ jobs: components: rustfmt - name: Run cargo fmt run: | - cargo fmt --all -- --check + cargo fmt --all --check # [impl->req~up-language-ci-linter~1] clippy: @@ -101,7 +101,7 @@ jobs: - name: Run cargo clippy run: | cargo clippy --version - cargo clippy --tests --examples + cargo clippy --all-targets --all-features --no-deps -- -W warnings -D warnings # [impl->req~up-language-ci-api-docs~1] docu: diff --git a/tools/fmt_clippy_doc.sh b/tools/fmt_clippy_doc.sh index 4e512ce..c0f1355 100755 --- a/tools/fmt_clippy_doc.sh +++ b/tools/fmt_clippy_doc.sh @@ -1,5 +1,12 @@ #!/bin/sh -cargo fmt -- --check -cargo clippy --all-targets -- -W warnings -D warnings -cargo doc -p up-rust --no-deps +echo "Running cargo fmt --check" +cargo fmt --all --check + +echo "" +echo "Running cargo clippy" +cargo clippy --all-targets --all-features --no-deps -- -W warnings -D warnings + +echo "" +echo "Running cargo doc" +cargo doc --no-deps --all-features