Auto merge of #90577 - matthiaskrgr:clippy_perf_nov, r=petrochenkov

clippy::perf fixes
This commit is contained in:
bors 2021-11-05 09:17:39 +00:00
commit 489ec310d2
9 changed files with 13 additions and 13 deletions

View file

@ -1838,7 +1838,7 @@ impl<'a, 'tcx> InferCtxtPrivExt<'tcx> for InferCtxt<'a, 'tcx> {
post.iter().map(|p| format!("- {}", p)).take(4).collect::<Vec<_>>().join("\n"),
post.len() - 4,
)
} else if post.len() > 1 || (post.len() == 1 && post[0].contains("\n")) {
} else if post.len() > 1 || (post.len() == 1 && post[0].contains('\n')) {
format!(":\n{}", post.iter().map(|p| format!("- {}", p)).collect::<Vec<_>>().join("\n"),)
} else if post.len() == 1 {
format!(": `{}`", post[0])