@@ -220,21 +220,21 @@ pub fn hex(n: u32) -> Tokens {
220
220
let mut t = Tokens :: new ( ) ;
221
221
let ( h2, h1) = ( ( n >> 16 ) & 0xffff , n & 0xffff ) ;
222
222
t. append ( if h2 != 0 {
223
- format ! ( "0x{:04x}_{:04x}" , h2, h1)
223
+ Ident :: from ( format ! ( "0x{:04x}_{:04x}" , h2, h1) )
224
224
} else if h1 & 0xff00 != 0 {
225
- format ! ( "0x{:04x}" , h1)
225
+ Ident :: from ( format ! ( "0x{:04x}" , h1) )
226
226
} else if h1 != 0 {
227
- format ! ( "0x{:02x}" , h1 & 0xff )
227
+ Ident :: from ( format ! ( "0x{:02x}" , h1 & 0xff ) )
228
228
} else {
229
- String :: from ( "0" )
229
+ Ident :: from ( "0" )
230
230
} ) ;
231
231
t
232
232
}
233
233
234
234
pub fn hex_or_bool ( n : u32 , width : u32 ) -> Tokens {
235
235
if width == 1 {
236
236
let mut t = Tokens :: new ( ) ;
237
- t. append ( if n == 0 { "false" } else { "true" } ) ;
237
+ t. append ( Ident :: from ( if n == 0 { "false" } else { "true" } ) ) ;
238
238
t
239
239
} else {
240
240
hex ( n)
@@ -244,14 +244,14 @@ pub fn hex_or_bool(n: u32, width: u32) -> Tokens {
244
244
/// Turns `n` into an unsuffixed token
245
245
pub fn unsuffixed ( n : u64 ) -> Tokens {
246
246
let mut t = Tokens :: new ( ) ;
247
- t. append ( format ! ( "{}" , n) ) ;
247
+ t. append ( Ident :: from ( format ! ( "{}" , n) ) ) ;
248
248
t
249
249
}
250
250
251
251
pub fn unsuffixed_or_bool ( n : u64 , width : u32 ) -> Tokens {
252
252
if width == 1 {
253
253
let mut t = Tokens :: new ( ) ;
254
- t. append ( if n == 0 { "false" } else { "true" } ) ;
254
+ t. append ( Ident :: from ( if n == 0 { "false" } else { "true" } ) ) ;
255
255
t
256
256
} else {
257
257
unsuffixed ( n)
0 commit comments