Update formatting
Some checks failed
timw4mail/rusty-numbers/pipeline/head There was a failure building this commit
Some checks failed
timw4mail/rusty-numbers/pipeline/head There was a failure building this commit
This commit is contained in:
parent
d90b762754
commit
d6b0825b9a
@ -6,14 +6,14 @@ use crate::num::*;
|
|||||||
#[cfg(all(feature = "alloc", not(feature = "std")))]
|
#[cfg(all(feature = "alloc", not(feature = "std")))]
|
||||||
extern crate alloc;
|
extern crate alloc;
|
||||||
#[cfg(all(feature = "alloc", not(feature = "std")))]
|
#[cfg(all(feature = "alloc", not(feature = "std")))]
|
||||||
use alloc::vec::*;
|
|
||||||
#[cfg(all(feature = "alloc", not(feature = "std")))]
|
|
||||||
use alloc::string::*;
|
use alloc::string::*;
|
||||||
|
#[cfg(all(feature = "alloc", not(feature = "std")))]
|
||||||
|
use alloc::vec::*;
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
use std::prelude::v1::*;
|
use std::prelude::v1::*;
|
||||||
|
|
||||||
use core::cmp::{Ordering, PartialOrd, PartialEq};
|
use core::cmp::{Ordering, PartialEq, PartialOrd};
|
||||||
use core::convert::*;
|
use core::convert::*;
|
||||||
use core::mem::replace;
|
use core::mem::replace;
|
||||||
use core::ops::{
|
use core::ops::{
|
||||||
@ -576,7 +576,7 @@ impl_from_larger!((i128, u128));
|
|||||||
impl_from_smaller!((i8, u8), (i16, u16), (i32, u32), (i64, u64));
|
impl_from_smaller!((i8, u8), (i16, u16), (i32, u32), (i64, u64));
|
||||||
|
|
||||||
// Implement PartialEq and PartialOrd to compare against BigInt values
|
// Implement PartialEq and PartialOrd to compare against BigInt values
|
||||||
impl_ord_literal!(i8,u8,i16,u16,i32,u32,i64,u64,i128,u128);
|
impl_ord_literal!(i8, u8, i16, u16, i32, u32, i64, u64, i128, u128);
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
#[cfg_attr(tarpaulin, skip)]
|
#[cfg_attr(tarpaulin, skip)]
|
||||||
@ -866,7 +866,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_from_large_unsigned() {
|
fn test_from_large_unsigned() {
|
||||||
let big_num: u128 = 9*RADIX + 8;
|
let big_num: u128 = 9 * RADIX + 8;
|
||||||
let res = BigInt::from(big_num);
|
let res = BigInt::from(big_num);
|
||||||
|
|
||||||
assert_eq!(res.sign, Sign::Positive, "{:#?}", res);
|
assert_eq!(res.sign, Sign::Positive, "{:#?}", res);
|
||||||
@ -876,7 +876,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_from_large_signed() {
|
fn test_from_large_signed() {
|
||||||
let big_num: i128 = 2*I_RADIX + 3;
|
let big_num: i128 = 2 * I_RADIX + 3;
|
||||||
let res = BigInt::from(-big_num);
|
let res = BigInt::from(-big_num);
|
||||||
|
|
||||||
assert_eq!(res.sign, Sign::Negative, "{:#?}", res);
|
assert_eq!(res.sign, Sign::Negative, "{:#?}", res);
|
||||||
|
@ -65,7 +65,7 @@ impl PartialOrd for Sign {
|
|||||||
Self::Negative => match other {
|
Self::Negative => match other {
|
||||||
Self::Positive => Some(Ordering::Less),
|
Self::Positive => Some(Ordering::Less),
|
||||||
Self::Negative => Some(Ordering::Equal),
|
Self::Negative => Some(Ordering::Equal),
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user