Skip to content

Commit ee41ad4

Browse files
committed
std: fix compile & test
1 parent c32fb53 commit ee41ad4

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/librustpkg/version.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ extern mod std;
1515

1616
use extra::semver;
1717
use core::prelude::*;
18+
use core::iterator::IteratorUtil;
1819
use core::{char, os, result, run, str};
1920
use package_path::RemotePath;
2021
use extra::tempfile::mkdtemp;
@@ -112,7 +113,7 @@ pub fn try_getting_version(remote_path: &RemotePath) -> Option<Version> {
112113
~"tag", ~"-l"]);
113114
let output_text = str::from_bytes(outp.output);
114115
debug!("Full output: ( %s ) [%?]", output_text, outp.status);
115-
for output_text.each_split_char('\n') |l| {
116+
for output_text.line_iter().advance |l| {
116117
debug!("A line of output: %s", l);
117118
if !l.is_whitespace() {
118119
output = Some(l);
@@ -162,11 +163,8 @@ fn try_parsing_version(s: &str) -> Option<Version> {
162163

163164
/// Just an approximation
164165
fn is_url_like(p: &RemotePath) -> bool {
165-
let mut n = 0;
166-
for p.to_str().each_split_char('/') |_| {
167-
n += 1;
168-
}
169-
n > 2
166+
let str = p.to_str();
167+
str.split_iter('/').count() > 2
170168
}
171169

172170
/// If s is of the form foo#bar, where bar is a valid version

src/libstd/run.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
1313
#[allow(missing_doc)];
1414

15+
use iterator::IteratorUtil;
1516
use cast;
1617
use comm::{stream, SharedChan, GenericChan, GenericPort};
1718
use int;

0 commit comments

Comments
 (0)