Skip to content

fix(service): allow unnecessary_cast for eCAL 6.0/6.1.1 compatibility#105

Merged
rex-schilasky merged 1 commit into
mainfrom
feat/ecal-6.1.1-compatibility
Apr 7, 2026
Merged

fix(service): allow unnecessary_cast for eCAL 6.0/6.1.1 compatibility#105
rex-schilasky merged 1 commit into
mainfrom
feat/ecal-6.1.1-compatibility

Conversation

@rex-schilasky
Copy link
Copy Markdown
Collaborator

eCAL_eCallState_* constants are generated as u32 by bindgen against eCAL 6.0.x headers, making the 'as i32' casts required. In eCAL 6.1.1 bindgen generates them as i32, making the casts redundant and triggering clippy's unnecessary_cast lint.

Suppress the lint with #[allow(clippy::unnecessary_cast)] on the From impl so the same code compiles cleanly against both eCAL versions.

eCAL_eCallState_* constants are generated as u32 by bindgen against eCAL
6.0.x headers, making the 'as i32' casts required. In eCAL 6.1.1 bindgen
generates them as i32, making the casts redundant and triggering clippy's
unnecessary_cast lint.

Suppress the lint with #[allow(clippy::unnecessary_cast)] on the From<i32>
impl so the same code compiles cleanly against both eCAL versions.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR keeps rustecal-service building cleanly across eCAL 6.0.x and 6.1.1 by suppressing clippy::unnecessary_cast where bindgen emits differing integral types for the same eCAL constants.

Changes:

  • Add #[allow(clippy::unnecessary_cast)] to the impl From<i32> for CallState conversion to tolerate u32/i32 bindgen differences between eCAL versions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rex-schilasky rex-schilasky merged commit 9afb5dc into main Apr 7, 2026
11 checks passed
@rex-schilasky rex-schilasky deleted the feat/ecal-6.1.1-compatibility branch April 7, 2026 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants