Skip to content

Commit 8bfe38c

Browse files
committed
Improve the match_same_arms doc
1 parent 45bb75b commit 8bfe38c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/copies.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ declare_lint! {
3838

3939
/// **What it does:** This lint checks for `match` with identical arm bodies.
4040
///
41-
/// **Why is this bad?** This is probably a copy & paste error.
41+
/// **Why is this bad?** This is probably a copy & paste error. If arm bodies are the same on
42+
/// purpose, you can factor them
43+
/// [using `|`](https://doc.rust-lang.org/book/patterns.html#multiple-patterns).
4244
///
4345
/// **Known problems:** Hopefully none.
4446
///

0 commit comments

Comments
 (0)