From 4b806b4d06a6b82771657f9b79728d3fba84ebed Mon Sep 17 00:00:00 2001 From: Huon Wilson Date: Sat, 8 Jun 2013 22:04:46 +1000 Subject: std: remove each_char* fns and methods from str, replaced by iterators. --- src/libsyntax/parse/comments.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/libsyntax/parse') diff --git a/src/libsyntax/parse/comments.rs b/src/libsyntax/parse/comments.rs index 54fba29a19a..22b9e7d6c5e 100644 --- a/src/libsyntax/parse/comments.rs +++ b/src/libsyntax/parse/comments.rs @@ -21,6 +21,7 @@ use parse::token; use parse::token::{get_ident_interner}; use parse; +use core::iterator::IteratorUtil; use core::io; use core::str; use core::uint; @@ -78,7 +79,7 @@ pub fn strip_doc_comment_decoration(comment: &str) -> ~str { if line.trim().is_empty() { loop; } - for line.each_chari |j, c| { + for line.iter().enumerate().advance |(j, c)| { if j >= i { break; } @@ -91,7 +92,7 @@ pub fn strip_doc_comment_decoration(comment: &str) -> ~str { return do lines.map |line| { let mut chars = ~[]; - for str::each_char(*line) |c| { chars.push(c) } + for line.iter().advance |c| { chars.push(c) } if i > chars.len() { ~"" } else { -- cgit 1.4.1-3-g733a5