Skip to content

Commit

Permalink
Make 'integer' subcrate #![no_std]
Browse files Browse the repository at this point in the history
  • Loading branch information
jswrenn committed Nov 1, 2016
1 parent 938ec63 commit e532d0b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions integer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

//! Integer trait and functions.

#![no_std]

extern crate num_traits as traits;

use traits::{Num, Signed};
Expand Down Expand Up @@ -263,7 +265,7 @@ macro_rules! impl_integer_for_isize {

while m != 0 {
m >>= m.trailing_zeros();
if n > m { ::std::mem::swap(&mut n, &mut m) }
if n > m { ::core::mem::swap(&mut n, &mut m) }
m -= n;
}

Expand Down Expand Up @@ -385,7 +387,7 @@ macro_rules! impl_integer_for_isize {
fn test_gcd_cmp_with_euclidean() {
fn euclidean_gcd(mut m: $T, mut n: $T) -> $T {
while m != 0 {
::std::mem::swap(&mut m, &mut n);
::core::mem::swap(&mut m, &mut n);
m %= n;
}

Expand Down Expand Up @@ -522,7 +524,7 @@ macro_rules! impl_integer_for_usize {

while m != 0 {
m >>= m.trailing_zeros();
if n > m { ::std::mem::swap(&mut n, &mut m) }
if n > m { ::core::mem::swap(&mut n, &mut m) }
m -= n;
}

Expand Down Expand Up @@ -596,7 +598,7 @@ macro_rules! impl_integer_for_usize {
fn test_gcd_cmp_with_euclidean() {
fn euclidean_gcd(mut m: $T, mut n: $T) -> $T {
while m != 0 {
::std::mem::swap(&mut m, &mut n);
::core::mem::swap(&mut m, &mut n);
m %= n;
}
n
Expand Down

0 comments on commit e532d0b

Please sign in to comment.