std: remove str::to_chars
This commit is contained in:
parent
8c59d920a1
commit
ebefe425b9
3 changed files with 6 additions and 10 deletions
|
|
@ -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('#') {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue