Things we did:

  • Reviewed Rust’s [Ownership] (https://doc.rust-lang.org/book/ownership.html) and [Borrowing] (https://doc.rust-lang.org/book/references-and-borrowing.html).
  • After reviewing, went through each line of the normalize function from yesterday.

Things we learned:

  • In Rust, only one thing can own a mutable reference at a time.
  • Many things can have a reference to another thing, but only if it’s an immutable reference.
  • Dereferencing is a tricky concept. It can also be done in a couple different ways. For example two code snippets below would do the same thing:
      for byte in &value[first_index..last_index + 1] {
                        normalized_value.push(*byte);   // dereferencing here
                        }
      for &byte in &value[first_index..last_index + 1] { // destructuring here
                        normalized_value.push(byte);
                        }

TODO:

  • Learn more Rust (always!)
  • Implement more of the Headers methods
  • Write tests for the append() method
    • Finish writing test for normalize function