From 6f8cdba88e760bbf19056b254d3aed7f60db6b30 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Feb 2024 23:01:15 +0100 Subject: [PATCH 1/3] Bump pre-commit/action from 3.0.0 to 3.0.1 (#249) --- .github/workflows/pre-commit.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml index c94f62f..8568e11 100644 --- a/.github/workflows/pre-commit.yaml +++ b/.github/workflows/pre-commit.yaml @@ -46,11 +46,11 @@ jobs: shared-key: ${{ github.workflow }}-${{ github.job }} - name: Detect code style issues (push) - uses: pre-commit/action@v3.0.0 + uses: pre-commit/action@v3.0.1 if: github.event_name == 'push' - name: Detect code style issues (pull_request) - uses: pre-commit/action@v3.0.0 + uses: pre-commit/action@v3.0.1 if: github.event_name == 'pull_request' env: SKIP: no-commit-to-branch From 51d100330892f07780bba75e70072b1ca5e73aac Mon Sep 17 00:00:00 2001 From: Uwe Klotz Date: Sat, 2 Mar 2024 17:22:00 +0100 Subject: [PATCH 2/3] Update pre-commit config and hooks (#250) --- .pre-commit-config.yaml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 09932d5..8691799 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,7 +25,7 @@ repos: - id: mixed-line-ending - id: trailing-whitespace - repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook - rev: v9.11.0 + rev: v9.12.0 hooks: - id: commitlint stages: @@ -44,7 +44,7 @@ repos: - id: codespell args: [--ignore-words=.codespellignore] - repo: https://github.com/sirosen/check-jsonschema - rev: 0.27.3 + rev: 0.28.0 hooks: - id: check-github-actions - id: check-github-workflows @@ -66,6 +66,7 @@ repos: - id: fmt args: [--all, --] - id: clippy + name: clippy --all-features args: [ --locked, @@ -76,6 +77,18 @@ repos: -D, warnings, ] + - id: clippy + name: clippy --no-default-features + args: + [ + --locked, + --workspace, + --no-default-features, + --all-targets, + --, + -D, + warnings, + ] - repo: local hooks: - id: cargo-doc From 6d2c31cbb13f0fac849d868817610f5012932fc4 Mon Sep 17 00:00:00 2001 From: Uwe Klotz Date: Sat, 9 Mar 2024 10:05:32 +0100 Subject: [PATCH 3/3] Fix clippy issues for --no-default-features --- src/service/mod.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/service/mod.rs b/src/service/mod.rs index 9f9b7bd..0dd738e 100644 --- a/src/service/mod.rs +++ b/src/service/mod.rs @@ -7,17 +7,19 @@ pub(crate) mod rtu; #[cfg(feature = "tcp")] pub(crate) mod tcp; -use std::io; - /// Check that `req_hdr` is the same `Header` as `rsp_hdr`. /// /// # Errors /// /// If the 2 headers are different, an [`io::Error`] will be returned with [`io::ErrorKind::InvalidData`]. -fn verify_response_header(req_hdr: &H, rsp_hdr: &H) -> io::Result<()> { +#[cfg(any(feature = "rtu", feature = "tcp"))] +fn verify_response_header( + req_hdr: &H, + rsp_hdr: &H, +) -> std::io::Result<()> { if req_hdr != rsp_hdr { - return Err(io::Error::new( - io::ErrorKind::InvalidData, + return Err(std::io::Error::new( + std::io::ErrorKind::InvalidData, format!( "Invalid response header: expected/request = {req_hdr:?}, actual/response = {rsp_hdr:?}" ),