Fix the examples

I'm new to rust so I don't know if this was due to a change in the
language spec or just a programming error, but either way this 
commit makes all 5 examples compile and run as expected.