recmo / uint

Rust Uint crate using const-generics
MIT License
170 stars 39 forks source link

uint's don't zero-pad when formatted with formatting specifier #369

Closed stanleyjzheng closed 4 months ago

stanleyjzheng commented 4 months ago

Version ruint 1.12.1

Platform Macos arm64

Description Ethers properly formats zero-padding with the format!() macro, but it seems like alloy's uints ignore it. A minimal example would be

use alloy_primitives::U256;

let x = U256::from(10);

assert_eq!(
    format!("{:0>width$}", x, width = 18_usize),
    format!("{:0>width$}", x.to_string(), width = 18_usize)
)