about summary refs log tree commit diff
path: root/src/libnum
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2014-08-07 12:56:26 -0700
committerBrian Anderson <banderson@mozilla.com>2014-08-13 15:27:37 -0700
commitbc450b17e3bfe1c195f8f286a3228cca1f706a74 (patch)
treea8f8ed6957c524055c8fbe2b390d98533abd2872 /src/libnum
parent4e1024f8d3721dccfac436abf99da9bf0febdc7f (diff)
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]
Diffstat (limited to 'src/libnum')
-rw-r--r--src/libnum/rational.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libnum/rational.rs b/src/libnum/rational.rs
index e0f6b4fb9af..f3e4b0b21ad 100644
--- a/src/libnum/rational.rs
+++ b/src/libnum/rational.rs
@@ -341,7 +341,7 @@ impl<T: FromStr + Clone + Integer + PartialOrd>
     FromStr for Ratio<T> {
     /// Parses `numer/denom` or just `numer`.
     fn from_str(s: &str) -> Option<Ratio<T>> {
-        let mut split = s.splitn('/', 1);
+        let mut split = s.splitn(1, '/');
 
         let num = split.next().and_then(|n| FromStr::from_str(n));
         let den = split.next().or(Some("1")).and_then(|d| FromStr::from_str(d));
@@ -357,7 +357,7 @@ impl<T: FromStrRadix + Clone + Integer + PartialOrd>
     FromStrRadix for Ratio<T> {
     /// Parses `numer/denom` where the numbers are in base `radix`.
     fn from_str_radix(s: &str, radix: uint) -> Option<Ratio<T>> {
-        let split: Vec<&str> = s.splitn('/', 1).collect();
+        let split: Vec<&str> = s.splitn(1, '/').collect();
         if split.len() < 2 {
             None
         } else {