Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It does indeed need to be proofread and that is annoying. It seems to me like the author just copy-pasted the completely wrong compiler output. Because in that section, he's trying to show how by having two distinct types for the arguments, the incorrect order would lead to a compiler error, as opposed to the case where both args were of type `bool` (and that this helps you avoid hard-to-spot mistakes at the point of invocation)


If they'd used a sane document language like LaTeX instead of markdown, it would have been trivial to actually run the examples on build.

Markdown has it's place... books is not it.


The book is written in mdbook which has built-in support for testing Rust examples [0], as well as running examples on the playground [1].

[0]: https://rust-lang.github.io/mdBook/cli/test.html

[1]: https://rust-lang.github.io/mdBook/format/mdbook.html#rust-p...


I agree LaTeX has it's uses, but... markdown can also do this trivially. See for example the Rust Book [1], and `cargo test` automatically runs example code in markdown doccomments.

[1] https://doc.rust-lang.org/stable/book/ch01-02-hello-world.ht...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: