@@ -204,14 +204,13 @@ macro_rules! header {
204
204
fn parse_header( raw: & $crate:: header:: Raw ) -> $crate:: Result <Self > {
205
205
$crate:: header:: parsing:: from_comma_delimited( raw) . map( $id)
206
206
}
207
- fn fmt_header( & self , f: & mut :: std :: fmt :: Formatter ) -> :: std:: fmt:: Result {
208
- $crate :: header :: parsing :: fmt_comma_delimited ( f , & self . 0 [ .. ] )
207
+ fn fmt_header( & self , f: & mut $crate :: header :: Formatter ) -> :: std:: fmt:: Result {
208
+ f . fmt_line ( self )
209
209
}
210
210
}
211
211
impl :: std:: fmt:: Display for $id {
212
212
fn fmt( & self , f: & mut :: std:: fmt:: Formatter ) -> :: std:: fmt:: Result {
213
- use $crate:: header:: Header ;
214
- self . fmt_header( f)
213
+ $crate:: header:: parsing:: fmt_comma_delimited( f, & self . 0 [ ..] )
215
214
}
216
215
}
217
216
} ;
@@ -229,14 +228,13 @@ macro_rules! header {
229
228
fn parse_header( raw: & $crate:: header:: Raw ) -> $crate:: Result <Self > {
230
229
$crate:: header:: parsing:: from_comma_delimited( raw) . map( $id)
231
230
}
232
- fn fmt_header( & self , f: & mut :: std :: fmt :: Formatter ) -> :: std:: fmt:: Result {
233
- $crate :: header :: parsing :: fmt_comma_delimited ( f , & self . 0 [ .. ] )
231
+ fn fmt_header( & self , f: & mut $crate :: header :: Formatter ) -> :: std:: fmt:: Result {
232
+ f . fmt_line ( self )
234
233
}
235
234
}
236
235
impl :: std:: fmt:: Display for $id {
237
236
fn fmt( & self , f: & mut :: std:: fmt:: Formatter ) -> :: std:: fmt:: Result {
238
- use $crate:: header:: Header ;
239
- self . fmt_header( f)
237
+ $crate:: header:: parsing:: fmt_comma_delimited( f, & self . 0 [ ..] )
240
238
}
241
239
}
242
240
} ;
@@ -254,8 +252,8 @@ macro_rules! header {
254
252
fn parse_header( raw: & $crate:: header:: Raw ) -> $crate:: Result <Self > {
255
253
$crate:: header:: parsing:: from_one_raw_str( raw) . map( $id)
256
254
}
257
- fn fmt_header( & self , f: & mut :: std :: fmt :: Formatter ) -> :: std:: fmt:: Result {
258
- :: std :: fmt :: Display :: fmt ( & * * self , f )
255
+ fn fmt_header( & self , f: & mut $crate :: header :: Formatter ) -> :: std:: fmt:: Result {
256
+ f . fmt_line ( self )
259
257
}
260
258
}
261
259
impl :: std:: fmt:: Display for $id {
@@ -289,8 +287,8 @@ macro_rules! header {
289
287
fn parse_header( raw: & $crate:: header:: Raw ) -> $crate:: Result <Self > {
290
288
$crate:: header:: parsing:: from_one_raw_str:: <<$value as :: std:: borrow:: ToOwned >:: Owned >( raw) . map( $id:: new)
291
289
}
292
- fn fmt_header( & self , f: & mut :: std :: fmt :: Formatter ) -> :: std:: fmt:: Result {
293
- :: std :: fmt :: Display :: fmt ( & * * self , f )
290
+ fn fmt_header( & self , f: & mut $crate :: header :: Formatter ) -> :: std:: fmt:: Result {
291
+ f . fmt_line ( self )
294
292
}
295
293
}
296
294
impl :: std:: fmt:: Display for $id {
@@ -323,20 +321,19 @@ macro_rules! header {
323
321
}
324
322
$crate:: header:: parsing:: from_comma_delimited( raw) . map( $id:: Items )
325
323
}
326
- fn fmt_header( & self , f: & mut :: std:: fmt:: Formatter ) -> :: std:: fmt:: Result {
324
+ fn fmt_header( & self , f: & mut $crate:: header:: Formatter ) -> :: std:: fmt:: Result {
325
+ f. fmt_line( self )
326
+ }
327
+ }
328
+ impl :: std:: fmt:: Display for $id {
329
+ fn fmt( & self , f: & mut :: std:: fmt:: Formatter ) -> :: std:: fmt:: Result {
327
330
match * self {
328
331
$id:: Any => f. write_str( "*" ) ,
329
332
$id:: Items ( ref fields) => $crate:: header:: parsing:: fmt_comma_delimited(
330
333
f, & fields[ ..] )
331
334
}
332
335
}
333
336
}
334
- impl :: std:: fmt:: Display for $id {
335
- fn fmt( & self , f: & mut :: std:: fmt:: Formatter ) -> :: std:: fmt:: Result {
336
- use $crate:: header:: Header ;
337
- self . fmt_header( f)
338
- }
339
- }
340
337
} ;
341
338
342
339
// optional test module
0 commit comments