Skip to content

Commit

Permalink
fix needless_borrow warnings in unsafe code
Browse files Browse the repository at this point in the history
  • Loading branch information
joseluis authored and knickish committed Nov 18, 2024
1 parent e8af859 commit d2bfd0b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/serde_bin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ where

// waiting for array_assume_init or core::array::map optimizations
// https://github.com/rust-lang/rust/issues/61956
Ok(unsafe { (&*(&to as *const _ as *const MaybeUninit<_>)).assume_init_read() })
Ok(unsafe { (*(&to as *const _ as *const MaybeUninit<_>)).assume_init_read() })
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/serde_ron.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,7 @@ where
// https://github.com/rust-lang/rust/issues/61956
// initializing before block close so that drop will run automatically if err encountered there
let initialized =
unsafe { (&*(&to as *const _ as *const MaybeUninit<_>)).assume_init_read() };
unsafe { (*(&to as *const _ as *const MaybeUninit<_>)).assume_init_read() };
o.paren_close(d)?;

Ok(initialized)
Expand Down

0 comments on commit d2bfd0b

Please sign in to comment.