fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

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