about summary refs log tree commit diff
path: root/src/docs/missing_trait_methods.txt
blob: 788ad764f8c3960c3334b8107b66c07829d14c96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
### What it does
Checks if a provided method is used implicitly by a trait
implementation. A usage example would be a wrapper where every method
should perform some operation before delegating to the inner type's
implemenation.

This lint should typically be enabled on a specific trait `impl` item
rather than globally.

### Why is this bad?
Indicates that a method is missing.

### Example
```
trait Trait {
    fn required();

    fn provided() {}
}

#[warn(clippy::missing_trait_methods)]
impl Trait for Type {
    fn required() { /* ... */ }
}
```
Use instead:
```
trait Trait {
    fn required();

    fn provided() {}
}

#[warn(clippy::missing_trait_methods)]
impl Trait for Type {
    fn required() { /* ... */ }

    fn provided() { /* ... */ }
}
```