Skip to content

Missing conversion to/from str with the nul terminator #5

@kupiakos

Description

@kupiakos

I expect these APIs to be available but they are not:

  • fn as_str_with_nul(&self) -> &str
  • fn from_str_until_nul(v: &str) -> Result<&CStr8, core::ffi::c_str::FromBytesWithNulError>
  • fn from_str_with_nul(v: &str) -> Result<&CStr8, core::ffi::c_str::FromBytesWithNulError>
  • unsafe fn from_str_with_nul_unchecked(v: &str) -> &CStr8

These can be worked around with unnecessary runtime checks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions