News for hackers. Stuff that matters.
Re:Almost Always Unsigned by cies on Sunday January 02, 2022 @09:47AM (#29769098)
Though, in idiomatic Rust I did not find the use of unsigned as mentioned in the article, signed for indexes is the norm.
Re:Almost Always Unsigned by tialaramex on Sunday January 02, 2022 @11:00AM (#29769783)
> in idiomatic Rust I did not find the use of unsigned as mentioned in the article, signed for indexes is the norm

Huh? If you write things[n] in Rust, and n isn't usize that's an error, you can't index things with the other primitive types at all out of the box.

Re:Almost Always Unsigned by berkut on Sunday January 02, 2022 @01:03PM (#29771502)
Wait, what?

Pretty much everything for indices (at least in the stdlib) seems to be 'usize' in my experience (i.e. Vec), which is unsigned.

Am I missing something?