File tree 1 file changed +15
-2
lines changed 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -36,14 +36,27 @@ declare_clippy_lint! {
36
36
/// argument may also fail to compile if you change the argument. Applying
37
37
/// this lint on them will fix the problem, but they may be in other crates.
38
38
///
39
+ /// One notable example of a function that may cause issues, and which cannot
40
+ /// easily be changed due to being in the standard library is `Vec::contains`.
41
+ /// when called on a `Vec<Vec<T>>`. If a `&Vec` is passed to that method then
42
+ /// it will compile, but if a `&[T]` is passed then it will not compile.
43
+ ///
44
+ /// ```ignore
45
+ /// fn cannot_take_a_slice(v: &Vec<u8>) -> bool {
46
+ /// let vec_of_vecs: Vec<Vec<u8>> = some_other_fn();
47
+ ///
48
+ /// vec_of_vecs.contains(v)
49
+ /// }
50
+ /// ```
51
+ ///
39
52
/// Also there may be `fn(&Vec)`-typed references pointing to your function.
40
53
/// If you have them, you will get a compiler error after applying this lint's
41
54
/// suggestions. You then have the choice to undo your changes or change the
42
55
/// type of the reference.
43
56
///
44
57
/// Note that if the function is part of your public interface, there may be
45
- /// other crates referencing it you may not be aware. Carefully deprecate the
46
- /// function before applying the lint suggestions in this case.
58
+ /// other crates referencing it, of which you may not be aware. Carefully
59
+ /// deprecate the function before applying the lint suggestions in this case.
47
60
///
48
61
/// **Example:**
49
62
/// ```ignore
You can’t perform that action at this time.
0 commit comments