DEV Community

Discussion on: Bevy #2: Space Shooter - The Player

Collapse
 
ajinkyax profile image
Ajinkya Borade

isn't usize is just an integer of i32 on 32bit system and i64 on 64bit system ? Please correct me if im wrong.

Collapse
 
mglolenstine profile image
MGlolenstine

usize is actually an unsigned type, which means that it can only be positive.

The pointer-sized unsigned integer type.

The size of this primitive is how many bytes it takes to reference any location in >memory. For example, on a 32 bit target, this is 4 bytes and on a 64 bit target, this is 8 bytes.

doc.rust-lang.org/std/primitive.us...