Skip to content

Commit 4efe36b

Browse files
committed
bigint module for rustpython-format
1 parent a398b11 commit 4efe36b

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

format/src/bigint.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#[cfg(feature = "malachite-bigint")]
2+
pub use malachite_bigint::{BigInt, Sign};
3+
#[cfg(feature = "num-bigint")]
4+
pub use num_bigint::{BigInt, Sign};

format/src/cformat.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
//! Implementation of Printf-Style string formatting
22
//! as per the [Python Docs](https://docs.python.org/3/library/stdtypes.html#printf-style-string-formatting).
3+
use crate::bigint::{BigInt, Sign};
34
use bitflags::bitflags;
4-
#[cfg(feature = "malachite-bigint")]
5-
use malachite_bigint::{BigInt, Sign};
6-
#[cfg(feature = "num-bigint")]
7-
use num_bigint::{BigInt, Sign};
85
use num_traits::Signed;
96
use rustpython_literal::{float, format::Case};
107
use std::{

format/src/format.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1+
use crate::bigint::{BigInt, Sign};
12
use itertools::{Itertools, PeekingNext};
2-
#[cfg(feature = "malachite-bigint")]
3-
use malachite_bigint::{BigInt, Sign};
4-
#[cfg(feature = "num-bigint")]
5-
use num_bigint::{BigInt, Sign};
63
use num_traits::FromPrimitive;
74
use num_traits::{cast::ToPrimitive, Signed};
85
use rustpython_literal::float;

format/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
mod bigint;
12
pub mod cformat;
23
mod format;
34

0 commit comments

Comments
 (0)