add ptr_offset_by_literal clippy lint and set to deny

This commit is contained in:
auronandace
2026-07-06 12:40:43 +01:00
parent 9930a90de0
commit bf6dc24407
15 changed files with 51 additions and 50 deletions
+1 -1
View File
@@ -478,7 +478,7 @@ pub unsafe extern "C" fn fgets(
let unget_read_size = cmp::min(left, stream.unget.len());
for _ in 0..unget_read_size {
unsafe { *out = stream.unget.pop().unwrap() as c_char };
out = unsafe { out.offset(1) };
out = unsafe { out.add(1) };
}
left -= unget_read_size;
}
+1 -1
View File
@@ -471,7 +471,7 @@ pub unsafe fn inner_scanf<T: Kind>(
{
if let Some(ref mut ptr) = ptr {
unsafe { **ptr = character as c_char };
*ptr = unsafe { ptr.offset(1) };
*ptr = unsafe { ptr.add(1) };
data_stored = true;
}
// Decrease the width, and read a new character unless the width is 0