diff options
| author | bors <bors@rust-lang.org> | 2014-08-14 05:36:25 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-08-14 05:36:25 +0000 |
| commit | 385c39a77b238df9371ee8bccc768b8d39258edd (patch) | |
| tree | 4d10ee4e9842587cccecdf5a4bf96ef13347362a /src/libsyntax | |
| parent | 9d45d63d0d18f21f74c8a2a4e5367a785932f64e (diff) | |
| parent | fce442e75c5b3df8eea401fae1200314f0d47c40 (diff) | |
| download | rust-385c39a77b238df9371ee8bccc768b8d39258edd.tar.gz rust-385c39a77b238df9371ee8bccc768b8d39258edd.zip | |
auto merge of #16332 : brson/rust/slicestab, r=aturon
This implements some of the recommendations from https://github.com/rust-lang/meeting-minutes/blob/master/Meeting-API-review-2014-08-06.md. Explanation in commits.
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/crateid.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libsyntax/crateid.rs b/src/libsyntax/crateid.rs index b9298cca4f8..67605360a48 100644 --- a/src/libsyntax/crateid.rs +++ b/src/libsyntax/crateid.rs @@ -51,7 +51,7 @@ impl fmt::Show for CrateId { impl FromStr for CrateId { fn from_str(s: &str) -> Option<CrateId> { - let pieces: Vec<&str> = s.splitn('#', 1).collect(); + let pieces: Vec<&str> = s.splitn(1, '#').collect(); let path = pieces.get(0).to_string(); if path.as_slice().starts_with("/") || path.as_slice().ends_with("/") || @@ -60,7 +60,7 @@ impl FromStr for CrateId { } let path_pieces: Vec<&str> = path.as_slice() - .rsplitn('/', 1) + .rsplitn(1, '/') .collect(); let inferred_name = *path_pieces.get(0); @@ -68,7 +68,7 @@ impl FromStr for CrateId { (inferred_name.to_string(), None) } else { let hash_pieces: Vec<&str> = pieces.get(1) - .splitn(':', 1) + .splitn(1, ':') .collect(); let (hash_name, hash_version) = if hash_pieces.len() == 1 { ("", *hash_pieces.get(0)) |
