]> git.lizzy.rs Git - rust.git/commitdiff
diagnostics: Fix E0303 explanation.
authorMichael Sproul <micsproul@gmail.com>
Mon, 13 Jul 2015 13:21:33 +0000 (23:21 +1000)
committerMichael Sproul <micsproul@gmail.com>
Mon, 13 Jul 2015 13:21:33 +0000 (23:21 +1000)
src/librustc/diagnostics.rs

index 9aa5daa3a0a275aae3742183ac4f3aa69fe1a68e..4b77c211df9839b603790b011556cb2913667f4d 100644 (file)
@@ -972,16 +972,16 @@ fn baz() {
 restriction, but for now patterns must be rewritten without sub-bindings.
 
 ```
-// Code like this...
-match Some(5) {
-    ref op_num @ Some(num) => ...
+// Before.
+match Some("hi".to_string()) {
+    ref op_string_ref @ Some(ref s) => ...
     None => ...
 }
 
 // After.
 match Some("hi".to_string()) {
     Some(ref s) => {
-        let op_string_ref = &Some(&s);
+        let op_string_ref = &Some(s);
         ...
     }
     None => ...