diff options
Diffstat (limited to 'src/tools/clippy/src/docs/type_repetition_in_bounds.txt')
-rw-r--r-- | src/tools/clippy/src/docs/type_repetition_in_bounds.txt | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/tools/clippy/src/docs/type_repetition_in_bounds.txt b/src/tools/clippy/src/docs/type_repetition_in_bounds.txt new file mode 100644 index 000000000..18ed372fd --- /dev/null +++ b/src/tools/clippy/src/docs/type_repetition_in_bounds.txt @@ -0,0 +1,16 @@ +### What it does +This lint warns about unnecessary type repetitions in trait bounds + +### Why is this bad? +Repeating the type for every bound makes the code +less readable than combining the bounds + +### Example +``` +pub fn foo<T>(t: T) where T: Copy, T: Clone {} +``` + +Use instead: +``` +pub fn foo<T>(t: T) where T: Copy + Clone {} +```
\ No newline at end of file |