# Advanced Hands-on Rust: Incorrect types in instructions (page 45)

**URL:** <https://forum.devtalk.com/t/advanced-hands-on-rust-incorrect-types-in-instructions-page-45/231014>\
**Category:** PragProg Customers\
**Tags:** book-advanced-hands-on-rust, errata\
**Created:** [22 January 2026 14:27 UTC](https://forum.devtalk.com/t/advanced-hands-on-rust-incorrect-types-in-instructions-page-45/231014 "2026-01-22T14:27:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![NekoiNemo](https://forum.devtalk.com/user_avatar/forum.devtalk.com/nekoinemo/32/3157_2.png) [@NekoiNemo](https://forum.devtalk.com/u/NekoiNemo)\
**Post date:** [22 January 2026 14:27 UTC](https://forum.devtalk.com/t/advanced-hands-on-rust-incorrect-types-in-instructions-page-45/231014/1 "2026-01-22T14:27:39Z")

</div>

> In this code, you generated a random u32 and then converted it to a usize to match the sprite index type. What you wanted was an **f32 between 0.1 and 0.9**. You can replace this code with a version that takes advantage of range() being generic:

The highlighted sentence seem like it came from a different part of the book (as it doesn’t even match the type in preceding one). This was suppose to be an “usize between 1 and 6”
