Possible typo in "Rust by Example"?

As I was reading the chapter on casting, I've noticed the following:

   // 128 as u8 -> -128, whose two's complement in eight bits is:
    println!(" 128 as a i8 is : {}", 128 as i8);

IMO the comment and the line below it do not match, and the comment should read 128 as i8 -> -128. WDYT?

1 Like

Looks like you're right. Feel free to open a PR to fix it; or an issue if you don't want to do it yourself :wink:

1 Like

Will do, TY

There you go:

the PR

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.