add ptr_offset_by_literal clippy lint and set to deny
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user