Hands-on Rust B4.0 183 - amulet char ambiguous for epub and few other thoughts

First, I’m quite enjoying the book. This has been my favorite resource so far that I’ve found for rust. Most of the tiny errors I noticed have been fixed up in the latest version, and from reading some of the threads there’s even more fixes coming.

I used the epub version of the book for my run through (Beta 3). I haven’t gone through the new stuff in B4.0 but I noticed this in 3 and is still in 4.

On the apparently superior PDF version the character for the amulet is pretty clearly the pipe character.

But in the epub version, it’s not that obvious.

I thought the book had a typo doing a slash instead of the pipe character, but I realized way later on that strings and chars seem to be in italics. Which is confusing for the pipe character.

Another thing that “broke my flow”, was needing to get the updated dungeon font. When adding mobs/themes/items. Why not just give an “empty” one for people who want to customize on their own, and a “filled out” one to go through the book. I don’t think it’s really much of a “spoilers” thing since we go over the design doc before writing code for the dungeon crawler. I don’t know if this is a side effect of the book being released in parts and those things not being finalized just yet.

I don’t know if I missed it mentioning this in the book, but something that might be helpful to point out is that if they forget to put “mod X” in their mod.rs file (for example, mod player_input in the systems/mod.rs), they might not get autocompletion/formatting/etc from the rust tooling. I seemed to forget putting it in a few times and I was really confused on why I wasn’t getting errors checked or formatting fixed.

This last thing might just be a rust tools thing…
I’m wondering is if any one else is having issues with autocompletion when using “use crate::prelude::*;” while writing a sub-module? I’m using VSCode. The prelude doesn’t have a problem in the main crate level. This is usually no problem except for when I need something out of bracket-lib or legion. I have a CS degree and I didn’t learn how to write “Dijkstra” until this.

1 Like

Wow, I had no idea that epub was going to cause an issue there. I’ll try to use a different glyph for the next beta.

I definitely agree on underlining the benefits of adding the mod x calls. It’s one of the topics that trips up newcomers to Rust (I understand why it doesn’t just include every .rs file - it’s helpful if you want to do advanced things like conditionally compile for a platform, but it’s confusing when you start). I’ll see if I can clarify that in a few places.

Which Rust plugin are you using for auto-complete? I’ve largely switched to rust-analyzer rather than the default Rust/RLS (it changed its name). It’s quite a bit faster, and generally pretty accurate on auto-complete by using a miniature version of the compiler. It’s come a long way recently; when I started the book, it was too unstable to recommend. Now, I’d have trouble living without it!

I’ll contemplate the font file. I may be able to claw back some page-count by making the font-file up front and reusing it. I need to strike a balance by not confusing people too much with a bunch of content up-front that won’t be used for several chapters. Anyone else want to chime in here? I’m leaning towards making the font up-front, just want to be sure that won’t confuse people!

2 Likes