Skip to content
This repository was archived by the owner on Feb 17, 2025. It is now read-only.

Commit c3debab

Browse files
committed
Fix display
1 parent 9978419 commit c3debab

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "malachite-bigint"
3-
version = "0.2.1"
3+
version = "0.2.2"
44
authors = ["Steve Shi <[email protected]>"]
55
edition = "2021"
66
license = "LGPL-3.0-only"

src/bigint.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ impl Neg for Sign {
7979
From,
8080
Into,
8181
)]
82-
#[display("{}", "self.0")]
82+
#[display("{}", self.0)]
8383
#[into(owned, ref, ref_mut)]
8484
pub struct BigInt(Integer);
8585

@@ -680,3 +680,9 @@ fn test_to_signed_bytes() {
680680
let i2 = BigInt::from_signed_bytes_le(&b);
681681
assert_eq!(i, i2);
682682
}
683+
684+
#[test]
685+
fn test_display_bigint() {
686+
let n = BigInt::from_str("1234567890").unwrap();
687+
assert_eq!(format!("{}", n), "1234567890");
688+
}

src/biguint.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ impl_primitive_convert!(BigUint, f64);
5454
From,
5555
Into,
5656
)]
57-
#[display("{}", "self.0")]
57+
#[display("{}", self.0)]
5858
#[into(owned, ref, ref_mut)]
5959
pub struct BigUint(pub(crate) Natural);
6060

@@ -487,3 +487,9 @@ impl BigUint {
487487
fn test_from_string_base() {
488488
assert!(BigUint::from_str_radix("1000000000000000111111100112abcdefg", 16).is_err());
489489
}
490+
491+
#[test]
492+
fn test_display_biguint() {
493+
let x = BigUint::from_str_radix("1234567890", 10).unwrap();
494+
assert_eq!(format!("{}", x), "1234567890");
495+
}

0 commit comments

Comments
 (0)