Skip to content

Need unsafe fn core::str::from_cstr_len #1666

Closed
@brson

Description

@brson

We have a function str::from_cstr but it assumes that C string is null-terminated. The only way I see to build a string from a non-null-terminated buffer is using str::from_bytes(vec::from_buf()) which requires an extra copy of the string.

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions