Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make CanFrame and CanFdFrame more rustic #1

Open
Kixunil opened this issue Dec 8, 2018 · 0 comments
Open

Make CanFrame and CanFdFrame more rustic #1

Kixunil opened this issue Dec 8, 2018 · 0 comments

Comments

@Kixunil
Copy link

Kixunil commented Dec 8, 2018

Currently these structures expose potentially invalid (uninitialized) data. This should be avoided in Rust. I'd suggest to make data and dlc fields private and provide data() method returning slice. Further, provide push_byte() and push_slice() methods for appending bytes.

Also data should probably use MaybeUninit<u8> instead of u8, but only after MaybeUninit is stabilized.

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

No branches or pull requests

1 participant