We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2485f8e commit e1cd24aCopy full SHA for e1cd24a
rust/kernel/device.rs
@@ -6,7 +6,7 @@
6
7
use crate::{
8
bindings,
9
- str::CString,
+ str::CStr,
10
types::{ARef, Opaque},
11
};
12
use core::{fmt, ptr};
@@ -183,8 +183,8 @@ impl Device {
183
}
184
185
/// Checks if property is present or not.
186
- pub fn property_present(&self, name: &CString) -> bool {
187
- // SAFETY: By the invariant of `CString`, `name` is null-terminated.
+ pub fn property_present(&self, name: &CStr) -> bool {
+ // SAFETY: By the invariant of `CStr`, `name` is null-terminated.
188
unsafe { bindings::device_property_present(self.as_raw().cast_const(), name.as_ptr() as *const _) }
189
190
0 commit comments