summaryrefslogtreecommitdiff
path: root/samples/rust
diff options
context:
space:
mode:
authorTamir Duberstein <tamird@gmail.com>2025-08-13 11:41:54 -0400
committerMiguel Ojeda <ojeda@kernel.org>2025-09-16 09:26:59 +0200
commita3a7d09ab8bf881ea64aa8f33c76554ab9b5f6d6 (patch)
tree9f948ff4636512131d76c82399e19b652e8cfd08 /samples/rust
parent7ad635c936f8b11496a9a83a539304a39e66cf45 (diff)
rust: configfs: use `core::ffi::CStr` method names
Prepare for `core::ffi::CStr` taking the place of `kernel::str::CStr` by avoid methods that only exist on the latter. Also avoid `Deref<Target=BStr> for CStr` as that impl doesn't exist on `core::ffi::CStr`. Link: https://github.com/Rust-for-Linux/linux/issues/1075 Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-by: Alice Ryhl <aliceryhl@google.com> Reviewed-by: Benno Lossin <lossin@kernel.org> Signed-off-by: Tamir Duberstein <tamird@gmail.com> Acked-by: Andreas Hindborg <a.hindborg@kernel.org> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'samples/rust')
-rw-r--r--samples/rust/rust_configfs.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/samples/rust/rust_configfs.rs b/samples/rust/rust_configfs.rs
index af04bfa35cb2..5005453f874d 100644
--- a/samples/rust/rust_configfs.rs
+++ b/samples/rust/rust_configfs.rs
@@ -94,7 +94,7 @@ impl configfs::AttributeOperations<0> for Configuration {
fn show(container: &Configuration, page: &mut [u8; PAGE_SIZE]) -> Result<usize> {
pr_info!("Show message\n");
- let data = container.message;
+ let data = container.message.to_bytes();
page[0..data.len()].copy_from_slice(data);
Ok(data.len())
}