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:
koka 2022-11-19 00:28:02 +09:00
parent 928a158716
commit 3c86cade4e
No known key found for this signature in database
GPG Key ID: A5917A40697774CD

View File

@ -16,6 +16,8 @@
/// ### What it does
/// 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?
/// The `std::mem::swap` function exposes the intent better
/// without deinitializing or copying either variable.