Started writing Append, i.e. putting every helper function together. Wrote if/then logic for going through Append method.
Ran into a lot of incompatible type issues. And we are still learning! :) :) :)
We decided to be more aware of each other when pair programming. :D
Used DOMRefCell instead of RefCell because DOMRefCell implements JSTraceable. With RefCell, the compiler threw an error saying it requires JSTraceable implementation.
The reason we need RefCell is that it allows interior mutability to immutable borrowed content. The header_list needs to be mutated while auto-generated HeadersBindings.rs will borrow Headers immutably.
Things we learned:
return can only return from the current function, i.e. you can’t return from an enclosing function in a closure.
match doesn’t introduce a new function or closure, so it is fine to return from a match arm
try! is awesome. Below two snippets would do the same thing.
It is even possible to save what comes out of try! without unpacking Ok():
'static is either (1) a reference that is valid for the whole program’s runtime, or (2) an owned pointer.
TODO:
Finish up writing Append.
Refactor the code to look cleaner.
Handle UTF8 conversion errors. (Also ask for second/third opinions on current implementation.)