]> git.lizzy.rs Git - rust.git/commitdiff
rollup merge of #19015: alex/libcore-typos
authorJakub Bukaj <jakub@jakub.cc>
Mon, 17 Nov 2014 23:24:02 +0000 (00:24 +0100)
committerJakub Bukaj <jakub@jakub.cc>
Mon, 17 Nov 2014 23:24:02 +0000 (00:24 +0100)
1  2 
src/libcore/num/mod.rs

diff --combined src/libcore/num/mod.rs
index 01c9277a20b75d79d96fddfac024a2be868e8b58,ab9d08813854cd1cb95ff10d574fc7c393b931bc..a794897ce6bc8dca662f5e6ecd88e40c6889bc17
@@@ -14,8 -14,6 +14,8 @@@
  
  #![allow(missing_docs)]
  
 +pub use self::FPCategory::*;
 +
  use {int, i8, i16, i32, i64};
  use {uint, u8, u16, u32, u64};
  use {f32, f64};
@@@ -198,7 -196,7 +198,7 @@@ pub trait In
      /// ```
      fn swap_bytes(self) -> Self;
  
-     /// Convert a integer from big endian to the target's endianness.
+     /// Convert an integer from big endian to the target's endianness.
      ///
      /// On big endian this is a no-op. On little endian the bytes are swapped.
      ///
          if cfg!(target_endian = "big") { x } else { x.swap_bytes() }
      }
  
-     /// Convert a integer from little endian to the target's endianness.
+     /// Convert an integer from little endian to the target's endianness.
      ///
      /// On little endian this is a no-op. On big endian the bytes are swapped.
      ///
@@@ -1457,10 -1455,10 +1457,10 @@@ macro_rules! from_str_radix_float_impl 
                  }
  
                  let (is_positive, src) =  match src.slice_shift_char() {
 -                    (None, _)        => return None,
 -                    (Some('-'), "")  => return None,
 -                    (Some('-'), src) => (false, src),
 -                    (Some(_), _)     => (true,  src),
 +                    None             => return None,
 +                    Some(('-', ""))  => return None,
 +                    Some(('-', src)) => (false, src),
 +                    Some((_, _))     => (true,  src),
                  };
  
                  // The significand to accumulate
                          // Parse the exponent as decimal integer
                          let src = src[offset..];
                          let (is_positive, exp) = match src.slice_shift_char() {
 -                            (Some('-'), src) => (false, from_str::<uint>(src)),
 -                            (Some('+'), src) => (true,  from_str::<uint>(src)),
 -                            (Some(_), _)     => (true,  from_str::<uint>(src)),
 -                            (None, _)        => return None,
 +                            Some(('-', src)) => (false, from_str::<uint>(src)),
 +                            Some(('+', src)) => (true,  from_str::<uint>(src)),
 +                            Some((_, _))     => (true,  from_str::<uint>(src)),
 +                            None             => return None,
                          };
  
                          match (is_positive, exp) {
@@@ -1606,7 -1604,7 +1606,7 @@@ macro_rules! from_str_radix_int_impl 
                  let is_signed_ty = (0 as $T) > Int::min_value();
  
                  match src.slice_shift_char() {
 -                    (Some('-'), src) if is_signed_ty => {
 +                    Some(('-', src)) if is_signed_ty => {
                          // The number is negative
                          let mut result = 0;
                          for c in src.chars() {
                          }
                          Some(result)
                      },
 -                    (Some(_), _) => {
 +                    Some((_, _)) => {
                          // The number is signed
                          let mut result = 0;
                          for c in src.chars() {
                          }
                          Some(result)
                      },
 -                    (None, _) => None,
 +                    None => None,
                  }
              }
          }