Re: [PATCH v3 4/4] rust: str: implement `Borrow` and `BorrowMut` for `CString`
From: Miguel Ojeda
Date: Sun Jun 15 2025 - 09:15:47 EST
On Sun, Jun 15, 2025 at 2:37 PM Alexandre Courbot <acourbot@xxxxxxxxxx> wrote:
>
> +/// // Borrowed from `str_data`.
> +/// let foo_borrowed = Foo(unsafe { CStr::from_bytes_with_nul_unchecked_mut(&mut str_data) });
We will need a `// SAFETY:` comment -- Clippy should complain.
Or to add a safe `from_bytes_with_nul_mut`, I guess.
Cheers,
Miguel