rust-clippy: use `write_all` since we're not expecting a partial write
Clippy caught this. This is a good lint in general, but here this was not
really a bug in this example code.
rust-clippy: tell clippy we care about keeping those `if` clauses separate
Thses were written this way because it spells out the logic in a more
explicit manner.