Skip to content

Commit edd7ad5

Browse files
committed
rust: kernel: clean beta Clippy needless_borrow warnings
The warning is now in the `style` group. Signed-off-by: Miguel Ojeda <[email protected]>
1 parent 26a4431 commit edd7ad5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

rust/kernel/chrdev.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ impl<const N: usize> Registration<{ N }> {
169169
// SAFETY: The adapter doesn't retrieve any state yet, so it's compatible with any
170170
// registration.
171171
let fops = unsafe { file_operations::FileOperationsVtable::<Self, T>::build() };
172-
let mut cdev = Cdev::alloc(fops, &this.this_module)?;
172+
let mut cdev = Cdev::alloc(fops, this.this_module)?;
173173
cdev.add(inner.dev + inner.used as bindings::dev_t, 1)?;
174174
inner.cdevs[inner.used].replace(cdev);
175175
inner.used += 1;

rust/kernel/error.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ impl fmt::Debug for Error {
112112
// SAFETY: `'static` string from C, and is not NULL.
113113
let cstr = unsafe { CStr::from_char_ptr(name) };
114114
// SAFETY: These strings are ASCII-only.
115-
let str = unsafe { str::from_utf8_unchecked(&cstr) };
115+
let str = unsafe { str::from_utf8_unchecked(cstr) };
116116
f.debug_tuple(str).finish()
117117
}
118118
}

0 commit comments

Comments
 (0)