]> git.proxmox.com Git - rustc.git/blobdiff - src/doc/rust-by-example/src/flow_control/for.md
New upstream version 1.50.0+dfsg1
[rustc.git] / src / doc / rust-by-example / src / flow_control / for.md
index 99e6458493eaf185ba7a62fbc6e9537a96a78fee..23445fe4fd68c960f7b86f2d5a93847cdc3b6008 100644 (file)
@@ -67,9 +67,12 @@ fn main() {
     for name in names.iter() {
         match name {
             &"Ferris" => println!("There is a rustacean among us!"),
+            // TODO ^ Try deleting the & and matching just "Ferris"
             _ => println!("Hello {}", name),
         }
     }
+    
+    println!("names: {:?}", names);
 }
 ```
 
@@ -77,7 +80,7 @@ fn main() {
   data is provided. Once the collection has been consumed it is no longer
   available for reuse as it has been 'moved' within the loop.
 
-```rust, editable
+```rust, editable, ignore
 fn main() {
     let names = vec!["Bob", "Frank", "Ferris"];
 
@@ -87,6 +90,9 @@ fn main() {
             _ => println!("Hello {}", name),
         }
     }
+    
+    println!("names: {:?}", names);
+    // FIXME ^ Comment out this line
 }
 ```