Re: [PATCH] rust: Improve CStr UTF-8 conversion methods

From: Miguel Ojeda
Date: Fri Aug 22 2025 - 17:36:10 EST


On Fri, Aug 22, 2025 at 10:57 PM Sami Daniel
<samidanielpersonal@xxxxxxxxx> wrote:
>
> Add safe conversion from CStr to &str with UTF-8 validation.
>
> - Returns Result<&str, Utf8Error> for safe conversion
> - Complements existing str methods on str.rs

Is there a use case in mind?

Please also note that we are trying to move to the `core` `CStr`, so
is this needed if that succeeds?

Cc'ing Tamir.

Thanks for the patch!

Cheers,
Miguel