num-bigint icon indicating copy to clipboard operation
num-bigint copied to clipboard

Debug output doesn't honor formatting specifier x

Open chkno opened this issue 2 years ago • 1 comments

use num_bigint::BigUint;
 
fn main() {
    let small = 32768usize;
    let big = BigUint::from(small);
    println!("{small:x} {big:x}");
    println!("{small:x?} {big:x?}");
}

Prints:

8000 8000
8000 32768

It should print:

8000 8000
8000 8000

chkno avatar Feb 10 '23 06:02 chkno

There's no public way for us to get that flag from the Formatter: https://github.com/rust-lang/rust/issues/48584

cuviper avatar Feb 11 '23 00:02 cuviper