Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.