I8 only goes up to 127 (puzzle 4)

Please use the following format for the title of this thread (then simply delete/replace this text with the content for the thread):

Title: Rust Brain Teasers: Byte-Sized Chunks

Hey Herb! (I’m baaaaack :slight_smile: )

just started on the Rust Brain Teasers.

On the Byte-Sized Chunks (Puzzle 4)

You have "“If you run the program in debug mode with cargo run, the program will display a series of numbers from 0 to 254 and then crash with the following error message: thread ’main’ panicked at ’attempt to add with overflow’, overflow\src\main.rs:6:9.”

That didn’t seem quite right, so I ran it and got what I expected. It worked up through 127 (not 254) and then gave the overflow message.

124
125
126
127
thread 'main' panicked at 'attempt to add with overflow', src/main.rs:5:8
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Welcome back, and thanks! I’m happy to say I’ve already submitted a fix for this one in beta 2.