Hands-on Rust: Chap 10 missing Chevron on added annotation

Title: Name of book: Hands-On Rust (Chapter 10 : Monstrous eyesight)

There is no chevron on the #[read_component(FieldOfView)] line. If you miss this addition, you get a somewhat obtuse panic.

BTW…

Just experimenting to see if I’m starting to “get it” and instead of adding the if ~fov.visible... return; code. I used a filter:

    movers
        .iter(ecs)
        .filter(|(_, _, _, fov)| fov.visible_tiles.contains(&player_pos))
        .for_each(|(entity, pos, _, _)| {
            // if !fov.visible_tiles.contains(&player_pos) {
            //     return;
            // }
            let idx = map_idx(pos.x, pos.y);

seems more rust-like, just thought I’d toss that out.

Thanks! Two good spots there - it’s definitely more Rusty to use a filter. I’ve logged this, it’ll be in the next beta.