Description
Fix three small syntax mistakes in a Rust starter project so it compiles and prints the flag.
Extract the archive, `cd fixme1`, and install Rust/Cargo if you don’t already have them.
Run `cargo run` to see the compiler complaints that point directly at the broken lines.
wget https://challenge-files.picoctf.net/c_verbal_sleep/3f0e13f541928f420d9c8c96b06d4dbf7b2fa18b15adbd457108e8c80a1f5883/fixme1.tar.gz
tar -xvf fixme1.tar.gz && cd fixme1
sudo apt install cargo -y
cargo run
Solution
- Step 1Add the missing semicolonLine 5 ends with a bare expression, so rewrite it as `let x = ...;` to silence the first error.
- Step 2Fix the return keywordLine 18 uses the shorthand `ret`. Replace it with the full `return` keyword so the function exits cleanly.
- Step 3Correct the println! format stringThe final `println!` macro uses `:?` even though it expects `{}`. Swap the placeholder and re-run `cargo run` to print the flag.
Flag
picoCTF{4r3_y0u_4_ru$t4c30n_...}
Follow-up challenges build on the same project. Keep Cargo installed if you plan to tackle Rust Fixme 2 and 3.