We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
#[allow]
1 parent 6a00a41 commit 8d4b87fCopy full SHA for 8d4b87f
rust/kernel/str.rs
@@ -193,11 +193,10 @@ impl Index<ops::RangeFrom<usize>> for CStr {
193
type Output = CStr;
194
195
#[inline]
196
- // Clippy false positive
197
- #[allow(clippy::unnecessary_operation)]
198
fn index(&self, index: ops::RangeFrom<usize>) -> &Self::Output {
199
// Delegate bounds checking to slice.
200
- &self.as_bytes()[index.start..];
+ // Assign to _ to mute clippy's unnecessary operation warning.
+ let _ = &self.as_bytes()[index.start..];
201
// SAFETY: We just checked the bounds.
202
unsafe { Self::from_bytes_with_nul_unchecked(&self.0[index.start..]) }
203
}
0 commit comments