rust-lang / nomicon

The Dark Arts of Advanced and Unsafe Rust Programming
https://doc.rust-lang.org/nomicon/
Apache License 2.0
1.79k stars 261 forks source link

Use pointer 'add' instead of 'offset' #265

Closed blkerby closed 3 years ago

blkerby commented 3 years ago

This a clean-up to use the add method on raw pointers where applicable, i.e., where offset was being used with a cast on the index from usize to isize. This implements a suggestion from Amanieu.

JohnTitor commented 3 years ago

cc/r? @Amanieu

Amanieu commented 3 years ago

LGTM

@bors r+