mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 07:44:10 +00:00
add how-to example for std::mem::transmute() usage instead of manual swap
This commit is contained in:
parent
72344f466f
commit
f7be2a0416
@ -20,6 +20,10 @@ use crate::utils::sugg::Sugg;
|
||||
/// b = a;
|
||||
/// a = t;
|
||||
/// ```
|
||||
/// Use std::mem::swap():
|
||||
/// ```rust
|
||||
/// std::mem::swap(&mut a, &mut b);
|
||||
/// ```
|
||||
declare_clippy_lint! {
|
||||
pub MANUAL_SWAP,
|
||||
complexity,
|
||||
|
Loading…
Reference in New Issue
Block a user