Skip to content

Use new CStr constants #745

@pronebird

Description

@pronebird

Hi,

If we bump MSRV to Rust 1.77 (Currently at 1.71 based on GH workflow), then I think we could use c"<constant>" syntax to generate &CStr constants, which would trim quite a bit of unsafe code, i.e:

pub const kIOKitBuildVersionKey: &CStr =
    unsafe { CStr::from_bytes_with_nul_unchecked(b"IOKitBuildVersion\0") };

would become:

pub const kIOKitBuildVersionKey: &CStr = c"IOKitBuildVersion";

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-frameworkAffects the framework crates and the translator for themenhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions