I have a code dump where I put rust code examples in case I forget something. I keep getting error: expected item, found 'let' for line 41+. Maybe my code is not structured properly? I just pasted the code snippets that I found out about into main.rs. I believe enumerations have some kind of special formatting or place.
I tried to change the names, considering that this is a naming convention; but it did not help. The same mistake.
Here's a dump (not too big yet)
#[allow(dead_code)] fn main() { } /////////////////////////////////////////tutorial functoins i made fn if_statements() { //let (x, y) = (5, 10); let x = 5; let y = if x == 5 { 10 } else { 15 }; if y == 15 {println!("y = {}", y);} } ////////////////////////////////////////// tutoiral functions
source share