]> git.proxmox.com Git - rustc.git/blob - src/tools/clippy/src/docs/type_repetition_in_bounds.txt
New upstream version 1.65.0+dfsg1
[rustc.git] / src / tools / clippy / src / docs / type_repetition_in_bounds.txt
1 ### What it does
2 This lint warns about unnecessary type repetitions in trait bounds
3
4 ### Why is this bad?
5 Repeating the type for every bound makes the code
6 less readable than combining the bounds
7
8 ### Example
9 ```
10 pub fn foo<T>(t: T) where T: Copy, T: Clone {}
11 ```
12
13 Use instead:
14 ```
15 pub fn foo<T>(t: T) where T: Copy + Clone {}
16 ```