diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e594ff55..428991ad 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -25,13 +25,13 @@ repos: - id: mixed-line-ending - id: trailing-whitespace - repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook - rev: v9.16.0 + rev: v9.17.0 hooks: - id: commitlint stages: - commit-msg - repo: https://github.com/DavidAnson/markdownlint-cli2 - rev: v0.13.0 + rev: v0.14.0 hooks: - id: markdownlint-cli2 - repo: https://github.com/shellcheck-py/shellcheck-py @@ -44,7 +44,7 @@ repos: - id: codespell args: [--ignore-words=.codespellignore] - repo: https://github.com/sirosen/check-jsonschema - rev: 0.29.1 + rev: 0.29.2 hooks: - id: check-github-actions - id: check-github-workflows diff --git a/src/codec/rtu.rs b/src/codec/rtu.rs index adb101d5..d1f0a57a 100644 --- a/src/codec/rtu.rs +++ b/src/codec/rtu.rs @@ -199,7 +199,7 @@ fn calc_crc(data: &[u8]) -> u16 { } } } - crc << 8 | crc >> 8 + crc.rotate_right(8) } fn check_crc(adu_data: &[u8], expected_crc: u16) -> Result<()> {