add how-to example for std::mem::transmute() usage instead of manual swap
This commit is contained in:
parent
72344f466f
commit
f7be2a0416
1 changed files with 4 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue