]> git.lizzy.rs Git - rust.git/blob - src/docs/ref_option_ref.txt
Auto merge of #9425 - kraktus:patch-1, r=xFrednet
[rust.git] / src / docs / ref_option_ref.txt
1 ### What it does
2 Checks for usage of `&Option<&T>`.
3
4 ### Why is this bad?
5 Since `&` is Copy, it's useless to have a
6 reference on `Option<&T>`.
7
8 ### Known problems
9 It may be irrelevant to use this lint on
10 public API code as it will make a breaking change to apply it.
11
12 ### Example
13 ```
14 let x: &Option<&u32> = &Some(&0u32);
15 ```
16 Use instead:
17 ```
18 let x: Option<&u32> = Some(&0u32);
19 ```