-
-
Save carols10cents/b40f10fdbdccf7a50b691b373ddece91 to your computer and use it in GitHub Desktop.
would clippy catch this copypasta?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn main() { | |
let list = vec![0, 1, 2, 3, 4, 5]; | |
let index = 3; | |
if true { | |
println!("the magic number is {}", list[index]); | |
} else { | |
let other_index = 5; | |
println!("the index is {}", other_index); // so you wouldn't get "unused variable other_index" | |
println!("the magic number is {}", list[index]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment