Skip to content

Instantly share code, notes, and snippets.

@sbillig
Created April 1, 2013 19:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sbillig/5287073 to your computer and use it in GitHub Desktop.
Save sbillig/5287073 to your computer and use it in GitHub Desktop.
Rust str each_char error.
use core::str::*;
fn main() {
let s = ~"hello";
let f = |ch| { io::println(fmt!("%?",ch)); true };
// Works:
each_char(s, f);
// Fails:
// s.each_char(f);
// Works:
for s.each_chari |_ch, _i| {}
// Works:
for s.each_char_reverse |_ch| {}
// Fails:
// for s.each_char |_ch| {}
// error: failed to find an implementation of trait core::io::Reader for <V10>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment