From 1121da0b75b4a7ae6345c3c1170c241220098c6c Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Thu, 3 Nov 2022 21:33:12 +0100 Subject: [PATCH] Finer-grained dependencies --- implementations/rust/oo/Cargo.toml | 3 ++- implementations/rust/oo/src/error.rs | 2 +- implementations/rust/oo/src/packed/reader.rs | 6 +++--- implementations/rust/oo/src/packed/writer.rs | 4 ++-- implementations/rust/oo/src/signed_integer.rs | 6 +++--- implementations/rust/oo/src/writer.rs | 2 +- 6 files changed, 12 insertions(+), 11 deletions(-) diff --git a/implementations/rust/oo/Cargo.toml b/implementations/rust/oo/Cargo.toml index 66fba05..2b62e8d 100644 --- a/implementations/rust/oo/Cargo.toml +++ b/implementations/rust/oo/Cargo.toml @@ -9,7 +9,8 @@ edition = "2021" base64 = "0.13" bytemuck = "1.12" dtoa = "0.4" -num = "0.4" +num-bigint = "0.4" +num-traits = "0.2" regex = "1.5" [package.metadata.workspaces] diff --git a/implementations/rust/oo/src/error.rs b/implementations/rust/oo/src/error.rs index e07fdc7..6cc0cf2 100644 --- a/implementations/rust/oo/src/error.rs +++ b/implementations/rust/oo/src/error.rs @@ -1,4 +1,4 @@ -use num::bigint::BigInt; +use num_bigint::BigInt; use std::convert::From; use std::io; diff --git a/implementations/rust/oo/src/packed/reader.rs b/implementations/rust/oo/src/packed/reader.rs index 5f4cd3c..ef86ca5 100644 --- a/implementations/rust/oo/src/packed/reader.rs +++ b/implementations/rust/oo/src/packed/reader.rs @@ -1,8 +1,8 @@ use crate::{ValueClass, AtomClass, Atom}; use crate::error::{self, ExpectedKind, io_eof}; -use num::bigint::BigInt; -use num::traits::cast::{FromPrimitive, ToPrimitive}; +use num_bigint::BigInt; +use num_traits::cast::{FromPrimitive, ToPrimitive}; use std::borrow::Cow; use std::convert::TryFrom; @@ -168,7 +168,7 @@ impl<'de, 'src, S: BinarySource<'de>> PackedReader<'de, 'src, S> { if count - i <= 16 { Ok(SignedInteger::from(u128::from_be_bytes(bs[bs.len() - 16..].try_into().unwrap()))) } else { - Ok(SignedInteger::from(Cow::Owned(BigInt::from_bytes_be(num::bigint::Sign::Plus, &bs[i..])))) + Ok(SignedInteger::from(Cow::Owned(BigInt::from_bytes_be(num_bigint::Sign::Plus, &bs[i..])))) } } else { // Negative. diff --git a/implementations/rust/oo/src/packed/writer.rs b/implementations/rust/oo/src/packed/writer.rs index a552e1f..bfff270 100644 --- a/implementations/rust/oo/src/packed/writer.rs +++ b/implementations/rust/oo/src/packed/writer.rs @@ -1,5 +1,5 @@ -use num::bigint::BigInt; -use num::cast::ToPrimitive; +use num_bigint::BigInt; +use num_traits::cast::ToPrimitive; use std::convert::TryInto; use std::io; use std::io::Write; diff --git a/implementations/rust/oo/src/signed_integer.rs b/implementations/rust/oo/src/signed_integer.rs index 2eae359..b64fe13 100644 --- a/implementations/rust/oo/src/signed_integer.rs +++ b/implementations/rust/oo/src/signed_integer.rs @@ -1,6 +1,6 @@ -use num::bigint::BigInt; -use num::traits::cast::ToPrimitive; -use num::traits::sign::Signed; +use num_bigint::BigInt; +use num_traits::cast::ToPrimitive; +use num_traits::sign::Signed; use std::borrow::Cow; use std::cmp::{Ord, Ordering, PartialOrd}; use std::convert::TryFrom; diff --git a/implementations/rust/oo/src/writer.rs b/implementations/rust/oo/src/writer.rs index d6f730c..a86fa30 100644 --- a/implementations/rust/oo/src/writer.rs +++ b/implementations/rust/oo/src/writer.rs @@ -1,4 +1,4 @@ -use num::bigint::BigInt; +use num_bigint::BigInt; use std::io; use crate::SignedInteger;