about summary refs log tree commit diff
path: root/src/librustpkg
diff options
context:
space:
mode:
authorHuon Wilson <dbau.pp+github@gmail.com>2013-06-11 00:49:19 +1000
committerHuon Wilson <dbau.pp+github@gmail.com>2013-06-11 00:49:19 +1000
commitebefe425b962d3914cc523d7f539fdb2244cec06 (patch)
tree0cc1f5e4804870961a6d04dcd7ea7f5b1e04042c /src/librustpkg
parent8c59d920a12fe40398a0033438ff426bb3387fd0 (diff)
downloadrust-ebefe425b962d3914cc523d7f539fdb2244cec06.tar.gz
rust-ebefe425b962d3914cc523d7f539fdb2244cec06.zip
std: remove str::to_chars
Diffstat (limited to 'src/librustpkg')
-rw-r--r--src/librustpkg/version.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/librustpkg/version.rs b/src/librustpkg/version.rs
index b38f440a941..434583eb79e 100644
--- a/src/librustpkg/version.rs
+++ b/src/librustpkg/version.rs
@@ -143,8 +143,7 @@ fn try_parsing_version(s: &str) -> Option<Version> {
     let s = s.trim();
     debug!("Attempting to parse: %s", s);
     let mut parse_state = Start;
-    // I gave up on using external iterators (tjc)
-    for str::to_chars(s).each() |&c| {
+    for s.iter().advance |&c| {
         if char::is_digit(c) {
             parse_state = SawDigit;
         }
@@ -172,7 +171,7 @@ fn is_url_like(p: &RemotePath) -> bool {
 /// Otherwise, return None.
 pub fn split_version<'a>(s: &'a str) -> Option<(&'a str, Version)> {
     // reject strings with multiple '#'s
-    if { let mut i: uint = 0; for str::to_chars(s).each |&c| { if c == '#' { i += 1; } }; i > 1 } {
+    if s.splitn_iter('#', 2).count() > 1 {
         return None;
     }
     match s.rfind('#') {