File tree Expand file tree Collapse file tree 4 files changed +4
-4
lines changed Expand file tree Collapse file tree 4 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ fn main() {
2626    // TODO: uncomment the line above and see the compiler error. The compiler 
2727    // suggests that we define a closure instead. 
2828
29-     // Closures are anonymous, here we are binding them to references 
29+     // Closures are anonymous, here we are binding them to references.  
3030    // Annotation is identical to function annotation but is optional 
3131    // as are the `{}` wrapping the body. These nameless functions 
3232    // are assigned to appropriately named variables. 
Original file line number Diff line number Diff line change 33Any type that implements the ` Eq `  and ` Hash `  traits can be a key in ` HashMap ` . 
44This includes:
55
6- *  ` bool `  (though not very useful since there is  only two possible keys)
6+ *  ` bool `  (though not very useful since there are  only two possible keys)
77*  ` int ` , ` uint ` , and all variations thereof
88*  ` String `  and ` &str `  (protip: you can have a ` HashMap `  keyed by ` String ` 
99and call ` .get() `  with an ` &str ` )
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ fn main() {
6262    } 
6363} 
6464
65- // The output is wrapped in a Result to allow matching on errors 
65+ // The output is wrapped in a Result to allow matching on errors.  
6666// Returns an Iterator to the Reader of the lines of the file. 
6767fn read_lines<P>(filename: P) -> io::Result<io::Lines<io::BufReader<File>>> 
6868where P: AsRef<Path>, { 
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ use std::thread;
3030fn main() { 
3131
3232    // This is our data to process. 
33-     // We will calculate the sum of all digits via a threaded   map-reduce algorithm. 
33+     // We will calculate the sum of all digits via a threaded map-reduce algorithm. 
3434    // Each whitespace separated chunk will be handled in a different thread. 
3535    // 
3636    // TODO: see what happens to the output if you insert spaces! 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments