fix: ast/message_id: use 0x1FFF_FFFF (1<<29 - 1) instead of 2^29 in test#77
fix: ast/message_id: use 0x1FFF_FFFF (1<<29 - 1) instead of 2^29 in test#77nyurik merged 3 commits intooxibus:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
this code in the original has always confused me - |
493d3ba to
7f7ac28
Compare
Clippy now emits the warning: error: using decimal literal for bitwise operation --> src/ast/message_id.rs:80:42 | 80 | let id = MessageId::Extended(2 ^ 29); | ^^ | = help: use binary (0b1_1101), hex (0x001d), or octal (0o35) notation for better readability = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.94.0/index.html#decimal_bitwise_operands = note: `-D clippy::decimal-bitwise-operands` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::decimal_bitwise_operands)]` The test should rather test 0x1FFF_FFFF (1<<29 - 1) instead of 2 XOR 29 (31)
7f7ac28 to
62c5439
Compare
|
I have confused myself as well yesterday. I believe the original intent was to test the maximal extended id Currently we dont check the validity of ID constructed via enum - maybe that would be good idea for both extended and standard ids? |
## 🤖 New release
* `can-dbc`: 8.1.0 -> 9.0.0 (⚠ API breaking changes)
### ⚠ `can-dbc` breaking changes
```text
--- failure copy_impl_added: type now implements Copy ---
Description:
A public type now implements Copy, causing non-move closures to capture it by reference instead of moving it.
ref: rust-lang/rust#100905
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.46.0/src/lints/copy_impl_added.ron
Failed in:
can_dbc::NumericValue in /tmp/.tmpiaRx6y/can-dbc/src/ast/numeric_value.rs:7
```
<details><summary><i><b>Changelog</b></i></summary><p>
<blockquote>
## [9.0.0](v8.1.0...v9.0.0) -
2026-03-20
### Fixed
- parse signal min/max as `NumericValue`
([#76](#76))
- ast/message_id: use 0x1FFF_FFFF (1<<29 - 1) instead of 2^29 in test
([#77](#77))
</blockquote>
</p></details>
---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).
Clippy now emits the warning/error in CI:
The test should rather test
0x1FFF_FFFF (1<<29 - 1)instead of2 XOR 29 (31)