feat(de): Remove dependency on the num crate.

This commit is contained in:
Erick Tryzelaar
2016-02-21 21:22:58 -08:00
parent 1132c0b0e1
commit 49b0bfd257
14 changed files with 410 additions and 204 deletions
-34
View File
@@ -3,11 +3,6 @@ use std::net;
use std::path::{Path, PathBuf};
use std::str;
use num::FromPrimitive;
use num::bigint::{BigInt, BigUint};
use num::complex::Complex;
use num::rational::Ratio;
use token::{self, Token};
//////////////////////////////////////////////////////////////////////////
@@ -278,35 +273,6 @@ declare_ser_tests! {
"1.2.3.4:1234".parse::<net::SocketAddrV4>().unwrap() => &[Token::Str("1.2.3.4:1234")],
"[::1]:1234".parse::<net::SocketAddrV6>().unwrap() => &[Token::Str("[::1]:1234")],
}
test_num_bigint {
BigInt::from_i64(123).unwrap() => &[Token::Str("123")],
BigInt::from_i64(-123).unwrap() => &[Token::Str("-123")],
}
test_num_biguint {
BigUint::from_i64(123).unwrap() => &[Token::Str("123")],
}
test_num_complex {
Complex::new(1, 2) => &[
Token::SeqStart(Some(2)),
Token::SeqSep,
Token::I32(1),
Token::SeqSep,
Token::I32(2),
Token::SeqEnd,
],
}
test_num_ratio {
Ratio::new(1, 2) => &[
Token::SeqStart(Some(2)),
Token::SeqSep,
Token::I32(1),
Token::SeqSep,
Token::I32(2),
Token::SeqEnd,
],
}
test_path {
Path::new("/usr/local/lib") => &[
Token::Str("/usr/local/lib"),