Skip to content

Commit 30019d1

Browse files
committed
Auto merge of rust-lang#8644 - yoav-lavi:squashed-master, r=flip1995
update unnecessary_join documentation changelog: none Updates the description of `unnecessary_join` in accordance with rust-lang/rust-clippy#8579 (comment). I've also added a line regarding differences in assembly output, please let me know if it should also make it in.
2 parents cf1e2e9 + 1ad6442 commit 30019d1

File tree

1 file changed

+5
-2
lines changed
  • clippy_lints/src/methods

1 file changed

+5
-2
lines changed

clippy_lints/src/methods/mod.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2055,7 +2055,7 @@ declare_clippy_lint! {
20552055
/// Checks for use of `.collect::<Vec<String>>().join("")` on iterators.
20562056
///
20572057
/// ### Why is this bad?
2058-
/// `.collect::<String>()` is more concise and usually more performant
2058+
/// `.collect::<String>()` is more concise and might be more performant
20592059
///
20602060
/// ### Example
20612061
/// ```rust
@@ -2070,9 +2070,12 @@ declare_clippy_lint! {
20702070
/// println!("{}", output);
20712071
/// ```
20722072
/// ### Known problems
2073-
/// While `.collect::<String>()` is more performant in most cases, there are cases where
2073+
/// While `.collect::<String>()` is sometimes more performant, there are cases where
20742074
/// using `.collect::<String>()` over `.collect::<Vec<String>>().join("")`
20752075
/// will prevent loop unrolling and will result in a negative performance impact.
2076+
///
2077+
/// Additionlly, differences have been observed between aarch64 and x86_64 assembly output,
2078+
/// with aarch64 tending to producing faster assembly in more cases when using `.collect::<String>()`
20762079
#[clippy::version = "1.61.0"]
20772080
pub UNNECESSARY_JOIN,
20782081
pedantic,

0 commit comments

Comments
 (0)