3 ms·
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
by xwowsersx 3y ago
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)
- TylerE 3y agoIf 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.
- cdirkx 3y agoI 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.html https://doc.rust-lang.org/stable/book/ch01-02-hello-world.ht...
- deleted 3y ago[deleted]
- bogeholm 3y agoThe 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 https://rust-lang.github.io/mdBook/cli/test.html [1]: https://rust-lang.github.io/mdBook/format/mdbook.html#rust-playground https://rust-lang.github.io/mdBook/format/mdbook.html#rust-p...