From bc450b17e3bfe1c195f8f286a3228cca1f706a74 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Thu, 7 Aug 2014 12:56:26 -0700 Subject: core: Change the argument order on splitn and rsplitn for strs. This makes it consistent with the same functions for slices, and allows the search closure to be specified last. [breaking-change] --- src/libsyntax/crateid.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/libsyntax') 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 { - 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)) -- cgit 1.4.1-3-g733a5