Last active
August 11, 2016 16:26
-
-
Save dholbrook/2e224f79197541b0f00d to your computer and use it in GitHub Desktop.
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 euler1() -> u32 { | |
// using fold() instead of sum() because of iter_arith stability | |
// "use of unstable library feature 'iter_arith': bounds recently changed (see issue #27739)" | |
(1..1000) | |
.filter(|n| n % 5 == 0 || n % 3 == 0) | |
.fold(0, |acc, n| acc + n) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment