Skip to content

Avoid unsafe by using new type instead of u8 for signal strength #217

@KonaeAkira

Description

@KonaeAkira

The unsafe block in question: https://github.com/MCHPR/MCHPRS/blob/f8b7b03b1cc09740437b1215cdcfbf13dde3e4fb/crates/redpiler/src/backend/direct/mod.rs#L153..L156

This unsafe block can be avoided at no extra runtime cost by using a new type instead of u8 for signal strength.

Proof of concept: https://godbolt.org/z/Kbs7arcKh

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions