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

ffi: simplify FromBytesWithNulError in core::c_str #132731

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Nov 7, 2024

  1. ffi: simplify FromBytesWithNulError in core::c_str

    `FromBytesWithNulError` is a struct that only contains `kind:
    FromBytesWithNulErrorKind`, which is an enum. This representation is
    somewhat redundant.
    
    Make `FromBytesWithNulError` an enum that is equivalent to current
    `FromBytesWithNulErrorKind` in order to simplify. Additionally, add docs
    for the enum members.
    
    Note that this change aligns `FromBytesWithNulError` more closely with
    `CStrConvertError` in the Linux kernel [1], which will utilize rustc's
    `CStr` in the future.
    
    [1]: https://github.com/Rust-for-Linux/linux/blob/ae7851c29747fa3765ecb722fe722117a346f988/rust/kernel/str.rs#L130-L138
    ohno418 committed Nov 7, 2024
    Configuration menu
    Copy the full SHA
    4c8ebb1 View commit details
    Browse the repository at this point in the history