File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -173,9 +173,9 @@ impl fmt::LowerHex for BigInt {
173
173
174
174
impl fmt:: UpperHex for BigInt {
175
175
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
176
- f . pad_integral ( ! self . is_negative ( ) ,
177
- "0x" ,
178
- & self . data . to_str_radix ( 16 ) . to_ascii_uppercase ( ) )
176
+ let mut s = self . data . to_str_radix ( 16 ) ;
177
+ s . make_ascii_uppercase ( ) ;
178
+ f . pad_integral ( ! self . is_negative ( ) , "0x" , & s )
179
179
}
180
180
}
181
181
Original file line number Diff line number Diff line change @@ -93,7 +93,9 @@ impl fmt::LowerHex for BigUint {
93
93
94
94
impl fmt:: UpperHex for BigUint {
95
95
fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
96
- f. pad_integral ( true , "0x" , & self . to_str_radix ( 16 ) . to_ascii_uppercase ( ) )
96
+ let mut s = self . to_str_radix ( 16 ) ;
97
+ s. make_ascii_uppercase ( ) ;
98
+ f. pad_integral ( true , "0x" , & s)
97
99
}
98
100
}
99
101
You can’t perform that action at this time.
0 commit comments