Skip to content

update unnecessary_join documentation #8644

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 6, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions clippy_lints/src/methods/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2055,7 +2055,7 @@ declare_clippy_lint! {
/// Checks for use of `.collect::<Vec<String>>().join("")` on iterators.
///
/// ### Why is this bad?
/// `.collect::<String>()` is more concise and usually more performant
/// `.collect::<String>()` is more concise and might be more performant
///
/// ### Example
/// ```rust
Expand All @@ -2070,9 +2070,12 @@ declare_clippy_lint! {
/// println!("{}", output);
/// ```
/// ### 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("")`
/// 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"]
pub UNNECESSARY_JOIN,
pedantic,
Expand Down