Created
April 1, 2013 19:26
-
-
Save sbillig/5287073 to your computer and use it in GitHub Desktop.
Rust str each_char error.
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
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