Note about const fn
Since `std::mem::swap` is not stable as a const fn, the suggestion would not be applicable in that cases
This commit is contained in:
parent
928a158716
commit
3c86cade4e
@ -16,6 +16,8 @@
|
|||||||
/// ### What it does
|
/// ### What it does
|
||||||
/// Checks for manual swapping.
|
/// Checks for manual swapping.
|
||||||
///
|
///
|
||||||
|
/// Note that the lint will not be emitted in const blocks, as the suggestion would not be applicable.
|
||||||
|
///
|
||||||
/// ### Why is this bad?
|
/// ### Why is this bad?
|
||||||
/// The `std::mem::swap` function exposes the intent better
|
/// The `std::mem::swap` function exposes the intent better
|
||||||
/// without deinitializing or copying either variable.
|
/// without deinitializing or copying either variable.
|
||||||
|
Loading…
Reference in New Issue
Block a user