update unnecessary_join documentation
This commit is contained in:
parent
cf1e2e9c1c
commit
1ad6442e91
@ -2055,7 +2055,7 @@ declare_clippy_lint! {
|
|||||||
/// Checks for use of `.collect::<Vec<String>>().join("")` on iterators.
|
/// Checks for use of `.collect::<Vec<String>>().join("")` on iterators.
|
||||||
///
|
///
|
||||||
/// ### Why is this bad?
|
/// ### Why is this bad?
|
||||||
/// `.collect::<String>()` is more concise and usually more performant
|
/// `.collect::<String>()` is more concise and might be more performant
|
||||||
///
|
///
|
||||||
/// ### Example
|
/// ### Example
|
||||||
/// ```rust
|
/// ```rust
|
||||||
@ -2070,9 +2070,12 @@ declare_clippy_lint! {
|
|||||||
/// println!("{}", output);
|
/// println!("{}", output);
|
||||||
/// ```
|
/// ```
|
||||||
/// ### Known problems
|
/// ### Known problems
|
||||||
/// While `.collect::<String>()` is more performant in most cases, there are cases where
|
/// While `.collect::<String>()` is sometimes more performant, there are cases where
|
||||||
/// using `.collect::<String>()` over `.collect::<Vec<String>>().join("")`
|
/// using `.collect::<String>()` over `.collect::<Vec<String>>().join("")`
|
||||||
/// will prevent loop unrolling and will result in a negative performance impact.
|
/// will prevent loop unrolling and will result in a negative performance impact.
|
||||||
|
///
|
||||||
|
/// Additionlly, differences have been observed between aarch64 and x86_64 assembly output,
|
||||||
|
/// with aarch64 tending to producing faster assembly in more cases when using `.collect::<String>()`
|
||||||
#[clippy::version = "1.61.0"]
|
#[clippy::version = "1.61.0"]
|
||||||
pub UNNECESSARY_JOIN,
|
pub UNNECESSARY_JOIN,
|
||||||
pedantic,
|
pedantic,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user