Skip to content

Instantly share code, notes, and snippets.

@carl-eastlund
Created August 19, 2013 23:19
Show Gist options
  • Select an option

  • Save carl-eastlund/6275344 to your computer and use it in GitHub Desktop.

Select an option

Save carl-eastlund/6275344 to your computer and use it in GitHub Desktop.
map over iterator
fn imap<A,B>( i : ~Iterator<A>, f : &fn(A)->B ) { i.map(f) }
fn main () {}
/*
iter.rs:1:50: 1:60 error: type `~std::iterator::Iterator<A>:Send` does not implement any method in scope named `map`
iter.rs:1 fn imap<A,B>( i : ~Iterator<A>, f : &fn(A)->B ) { i.map(f) }
^~~~~~~~~~
error: aborting due to previous error
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment