File tree Expand file tree Collapse file tree 1 file changed +3
-16
lines changed
gitoxide-core/src/repository/index Expand file tree Collapse file tree 1 file changed +3
-16
lines changed Original file line number Diff line number Diff line change @@ -294,13 +294,7 @@ pub(crate) mod function {
294
294
Ok ( ( pathspec. into_parts ( ) . 0 , index, cache) )
295
295
}
296
296
297
- #[ cfg( feature = "serde" ) ]
298
- #[ derive( serde:: Serialize ) ]
299
- struct AttrsForSerde {
300
- is_excluded : bool ,
301
- attributes : Vec < String > ,
302
- }
303
-
297
+ #[ cfg_attr( feature = "serde" , derive( serde:: Serialize ) ) ]
304
298
struct Attrs {
305
299
is_excluded : bool ,
306
300
attributes : Vec < gix:: attrs:: Assignment > ,
@@ -337,7 +331,7 @@ pub(crate) mod function {
337
331
flags : u32 ,
338
332
mode : u32 ,
339
333
path : std:: borrow:: Cow < ' a , str > ,
340
- meta : Option < AttrsForSerde > ,
334
+ meta : Option < Attrs > ,
341
335
}
342
336
343
337
serde_json:: to_writer (
@@ -354,14 +348,7 @@ pub(crate) mod function {
354
348
path. extend_from_slice ( entry. path ( index) ) ;
355
349
path. to_string ( ) . into ( )
356
350
} ,
357
- meta : attrs. map ( |attrs| AttrsForSerde {
358
- is_excluded : attrs. is_excluded ,
359
- attributes : attrs
360
- . attributes
361
- . into_iter ( )
362
- . map ( |attr| attr. as_ref ( ) . to_string ( ) )
363
- . collect ( ) ,
364
- } ) ,
351
+ meta : attrs,
365
352
} ,
366
353
) ?;
367
354
You can’t perform that action at this time.
0 commit comments