Created
September 24, 2012 06:50
-
-
Save awreece/3774664 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
$ rustc main.rs | |
main.rs:22:7: 22:16 warning: unused variable: `prev_fib` | |
main.rs:22 let (prev_fib, curr_fib) = (curr_fib, curr_fib+prev_fib); | |
^~~~~~~~~ | |
main.rs:22:17: 22:26 warning: unused variable: `curr_fib` | |
main.rs:22 let (prev_fib, curr_fib) = (curr_fib, curr_fib+prev_fib); | |
^~~~~~~~~ |
This file contains hidden or 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
let mut prev_fib = 0; | |
let mut curr_fib = 1; | |
while curr_fib < 1000 { | |
io::println(#fmt("%u", curr_fib)); | |
let (prev_fib, curr_fib) = (curr_fib, curr_fib+prev_fib); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment