Created
October 13, 2013 22:23
-
-
Save wilmoore/6968040 to your computer and use it in GitHub Desktop.
I've spent way too much time on this already...
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
| less-than-100.rs:1:128: 1:136 error: mismatched types: expected `&fn<no-bounds>(&&<VI5>) -> bool` but found `()` (expected fn but found ()) | |
| } assert_eq!(out, ~[5, 50, 35]);(100));ro; }; | |
| ^~~~~~~~ | |
| <std-macros>:89:22: 89:47 error: binary operation == cannot be applied to type `std::iter::Filter<,&<VI5>,std::vec::VecIterator<,<VI5>>>` | |
| <std-macros>:89 if !((given_val == expected_val) && (expected_val == given_val)) { | |
| ^~~~~~~~~~~~~~~~~~~~~~~~~ | |
| <std-macros>:83:4: 94:5 note: in expansion of assert_eq! | |
| less-than-100.rs:1:141: 1:171 note: expansion site | |
| <std-macros>:89:69: 89:78 error: mismatched types: expected `~[<VI9>]` but found `std::iter::Filter<,&<VI5>,std::vec::VecIterator<,<VI5>>>` (expected vector but found struct std::iter::Filter) | |
| <std-macros>:89 if !((given_val == expected_val) && (expected_val == given_val)) { | |
| ^~~~~~~~~ | |
| <std-macros>:83:4: 94:5 note: in expansion of assert_eq! | |
| less-than-100.rs:1:141: 1:171 note: expansion site | |
| error: aborting due to 3 previous errors |
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
| fn main() { | |
| let lt = |ro: int| { |lo: int| lo < ro; }; | |
| let num = [5, 500, 50, 101, 200, 35]; | |
| let out = num.iter().filter(lt(100)); | |
| assert_eq!(out, ~[5, 50, 35]); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following seems to work: (I found you on twitter and got some help on #rust)