]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
samples: rust: debugfs: use `core::ffi::CStr` method names
authorMiguel Ojeda <ojeda@kernel.org>
Sun, 19 Oct 2025 20:13:49 +0000 (22:13 +0200)
committerMiguel Ojeda <ojeda@kernel.org>
Mon, 20 Oct 2025 02:04:23 +0000 (04:04 +0200)
Prepare for `core::ffi::CStr` taking the place of `kernel::str::CStr` by
avoiding methods that only exist on the latter.

This backslid in commit d4a5d397c7fb ("samples: rust: Add scoped debugfs
sample driver").

Link: https://patch.msgid.link/20251019213049.2060970-1-ojeda@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
samples/rust/rust_debugfs_scoped.rs

index b0c4e76b123eaa161add593818bebe9072cfe78e..eb870e9986b83bc83f1e8446f491a1c6926dc4cf 100644 (file)
@@ -38,7 +38,7 @@ fn remove_file_write(
     mod_data
         .devices
         .lock()
-        .retain(|device| device.name.as_bytes() != to_remove.as_bytes());
+        .retain(|device| device.name.to_bytes() != to_remove.to_bytes());
     Ok(())
 }