Re: [PATCH RESEND v5] rust: str: Use `core::CStr`, remove the custom `CStr` implementation

2024-08-19 Thread Michal Rostecki
On 8/19/24 17:36, Michal Rostecki wrote: From: Michal Rostecki `CStr` became a part of `core` library in Rust 1.75. This change replaces the custom `CStr` implementation with the one from `core`. `core::CStr` behaves generally the same as the removed implementation, with the following

[PATCH RESEND v5] rust: str: Use `core::CStr`, remove the custom `CStr` implementation

2024-08-19 Thread Michal Rostecki
From: Michal Rostecki `CStr` became a part of `core` library in Rust 1.75. This change replaces the custom `CStr` implementation with the one from `core`. `core::CStr` behaves generally the same as the removed implementation, with the following differences: - It does not implement `Display

[PATCH v5] rust: str: Use `core::CStr`, remove the custom `CStr` implementation

2024-07-17 Thread Michal Rostecki
`CStrDisplay` wrapper, with a custom `Display` implementation. `DerefMut` implementation for `CString` is removed here, as it's not being used anywhere. Signed-off-by: Michal Rostecki --- v1 -> v2: - Do not remove `c_str` macro. While it's preferred to use C-string literals, there

[PATCH v4] rust: str: Use `core::CStr`, remove the custom `CStr` implementation

2024-07-17 Thread Michal Rostecki
`CStrDisplay` wrapper, with a custom `Display` implementation. `DerefMut` implementation for `CString` is removed here, as it's not being used anywhere. Signed-off-by: Michal Rostecki --- v1 -> v2: - Do not remove `c_str` macro. While it's preferred to use C-string literals, there

Re: [PATCH] rust: str: Use `core::CStr`, remove the custom `CStr` implementation

2024-07-17 Thread Michal Rostecki
On 16.07.24 09:44, Miguel Ojeda wrote: On Mon, Jul 15, 2024 at 6:12 PM Michal Rostecki wrote: @@ -71,11 +75,11 @@ macro_rules! kunit_assert { // // This mimics KUnit's failed assertion format. $crate::kunit::err(format

Re: [PATCH v3] rust: str: Use `core::CStr`, remove the custom `CStr` implementation

2024-07-17 Thread Michal Rostecki
On 16.07.24 02:45, Trevor Gross wrote: (also, v2 and v3 are appearing in different threads on lore (as they should), but they're in the same thread as v1 in my email client - any idea if there is a reason for this?) No idea, I've sent both patches with: git send-email --cc-cmd='./scripts/get_m

[PATCH v3] rust: str: Use `core::CStr`, remove the custom `CStr` implementation

2024-07-15 Thread Michal Rostecki
with the owned `CString` type. - It has `as_ptr()` method instead of `as_char_ptr()`, which also returns `*const c_char`. Signed-off-by: Michal Rostecki --- v1 -> v2: - Do not remove `c_str` macro. While it's preferred to use C-string literals, there are two cases where `c_str` is help

[PATCH v2] rust: str: Use `core::CStr`, remove the custom `CStr` implementation

2024-07-15 Thread Michal Rostecki
&CStr`), while mutating is done only with the owned `CString` type. - It has `as_ptr()` method instead of `as_char_ptr()`, which also returns `*const c_char`. Signed-off-by: Michal Rostecki --- v1 -> v2: - Do not remove `c_str` macro. While it's preferred to use C-string literals,

Re: [PATCH] rust: str: Use `core::CStr`, remove the custom `CStr` implementation

2024-07-15 Thread Michal Rostecki
On 15.07.24 17:56, Björn Roy Baron wrote: On Monday, July 15th, 2024 at 17:46, Michal Rostecki wrote: On 14.07.24 19:01, Björn Roy Baron wrote: On Sunday, July 14th, 2024 at 18:02, Michal Rostecki wrote: `CStr` became a part of `core` library in Rust 1.75, therefore there is no need to

Re: [PATCH] rust: str: Use `core::CStr`, remove the custom `CStr` implementation

2024-07-15 Thread Michal Rostecki
On 14.07.24 19:30, Miguel Ojeda wrote: Hi Michal, Thanks for the patch! Some notes below... On Sun, Jul 14, 2024 at 6:02 PM Michal Rostecki wrote: `CStr` became a part of `core` library in Rust 1.75, therefore there is no need to keep the custom implementation. It would depend on the

Re: [PATCH] rust: str: Use `core::CStr`, remove the custom `CStr` implementation

2024-07-15 Thread Michal Rostecki
On 14.07.24 19:01, Björn Roy Baron wrote: On Sunday, July 14th, 2024 at 18:02, Michal Rostecki wrote: `CStr` became a part of `core` library in Rust 1.75, therefore there is no need to keep the custom implementation. `core::CStr` behaves generally the same as the removed implementation

[PATCH] rust: str: Use `core::CStr`, remove the custom `CStr` implementation

2024-07-14 Thread Michal Rostecki
not supposed to be modified. - It has `as_ptr()` method instead of `as_char_ptr()`, which also returns `*const c_char`. Rust also introduces C literals (`c""`), so the `c_str` macro is removed here as well. Signed-off-by: Michal Rostecki --- rust/kernel/error.rs| 7 +- rust/