]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/src/docs/type_repetition_in_bounds.txt
Rollup merge of #101740 - andrewpollack:add-ignore-fuchsia-ui-tests, r=tmandry
[rust.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 ```