]> git.lizzy.rs Git - rust.git/blob - tests/ui/match_as_ref.stderr
iterate List by value
[rust.git] / tests / ui / match_as_ref.stderr
1 error: use `as_ref()` instead
2   --> $DIR/match_as_ref.rs:8:33
3    |
4 LL |       let borrowed: Option<&()> = match owned {
5    |  _________________________________^
6 LL | |         None => None,
7 LL | |         Some(ref v) => Some(v),
8 LL | |     };
9    | |_____^ help: try this: `owned.as_ref()`
10    |
11    = note: `-D clippy::match-as-ref` implied by `-D warnings`
12
13 error: use `as_mut()` instead
14   --> $DIR/match_as_ref.rs:14:39
15    |
16 LL |       let borrow_mut: Option<&mut ()> = match mut_owned {
17    |  _______________________________________^
18 LL | |         None => None,
19 LL | |         Some(ref mut v) => Some(v),
20 LL | |     };
21    | |_____^ help: try this: `mut_owned.as_mut()`
22
23 error: use `as_ref()` instead
24   --> $DIR/match_as_ref.rs:30:13
25    |
26 LL | /             match self.source {
27 LL | |                 Some(ref s) => Some(s),
28 LL | |                 None => None,
29 LL | |             }
30    | |_____________^ help: try this: `self.source.as_ref().map(|x| x as _)`
31
32 error: aborting due to 3 previous errors
33