Skip to content

Commit

Permalink
Ignore ptr_as_ptr pedantic clippy lint
Browse files Browse the repository at this point in the history
    warning: `as` casting between raw pointers without changing its mutability
      --> src/bytearray.rs:55:20
       |
    55 |         unsafe { &*(bytes as *const [u8; N] as *const ByteArray<N>) }
       |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try `pointer::cast`, a safer alternative: `(bytes as *const [u8; N]).cast::<ByteArray<N>>()`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_as_ptr
       = note: `-W clippy::ptr-as-ptr` implied by `-W clippy::pedantic`
       = help: to override `-W clippy::pedantic` add `#[allow(clippy::ptr_as_ptr)]`
  • Loading branch information
dtolnay committed Dec 27, 2023
1 parent 7c664c0 commit 677457b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
clippy::into_iter_without_iter,
clippy::missing_errors_doc,
clippy::must_use_candidate,
clippy::needless_doctest_main
clippy::needless_doctest_main,
clippy::ptr_as_ptr
)]

mod bytearray;
Expand Down

0 comments on commit 677457b

Please sign in to comment.