In Rust doc tests, you can use the # line prefix to hide lines. This prevents them from showing up in your helpful minimal explanations, and allows you to avoid repetitive boilerplate or tests.
In #295, I tried to do the same thing, as our examples our currently compiled. However, this does not work:

Fixing this is critical for the new book release: we either need to enable hiding in some form or figure out an alternate approach to compiling examples.