@@ -312,7 +312,6 @@ fn import_url(stack: Stack, matches: &clap::ArgMatches) -> Result<()> {
312
312
}
313
313
}
314
314
315
- #[ cfg( feature = "import-compressed" ) ]
316
315
fn import_tgz_series ( stack : Stack , matches : & clap:: ArgMatches , source_path : & Path ) -> Result < ( ) > {
317
316
let source_file = std:: fs:: File :: open ( source_path) ?;
318
317
let mut archive = tar:: Archive :: new ( flate2:: read:: GzDecoder :: new ( source_file) ) ;
@@ -322,7 +321,6 @@ fn import_tgz_series(stack: Stack, matches: &clap::ArgMatches, source_path: &Pat
322
321
return import_series ( stack, matches, Some ( series_path. as_path ( ) ) ) ;
323
322
}
324
323
325
- #[ cfg( feature = "import-compressed" ) ]
326
324
fn import_tbz2_series ( stack : Stack , matches : & clap:: ArgMatches , source_path : & Path ) -> Result < ( ) > {
327
325
let source_file = std:: fs:: File :: open ( source_path) ?;
328
326
let mut archive = tar:: Archive :: new ( bzip2_rs:: DecoderReader :: new ( source_file) ) ;
@@ -332,7 +330,6 @@ fn import_tbz2_series(stack: Stack, matches: &clap::ArgMatches, source_path: &Pa
332
330
return import_series ( stack, matches, Some ( series_path. as_path ( ) ) ) ;
333
331
}
334
332
335
- #[ cfg( feature = "import-compressed" ) ]
336
333
fn import_tar_series ( stack : Stack , matches : & clap:: ArgMatches , source_path : & Path ) -> Result < ( ) > {
337
334
let source_file = std:: fs:: File :: open ( source_path) ?;
338
335
let mut archive = tar:: Archive :: new ( source_file) ;
@@ -342,27 +339,6 @@ fn import_tar_series(stack: Stack, matches: &clap::ArgMatches, source_path: &Pat
342
339
return import_series ( stack, matches, Some ( series_path. as_path ( ) ) ) ;
343
340
}
344
341
345
- #[ cfg( not( feature = "import-compressed" ) ) ]
346
- fn import_tgz_series ( _: Stack , _: & clap:: ArgMatches , _: & Path ) -> Result < ( ) > {
347
- Err ( anyhow ! (
348
- "StGit not built with support for compressed series"
349
- ) )
350
- }
351
-
352
- #[ cfg( not( feature = "import-compressed" ) ) ]
353
- fn import_tbz2_series ( _: Stack , _: & clap:: ArgMatches , _: & Path ) -> Result < ( ) > {
354
- Err ( anyhow ! (
355
- "StGit not built with support for compressed series"
356
- ) )
357
- }
358
-
359
- #[ cfg( not( feature = "import-compressed" ) ) ]
360
- fn import_tar_series ( _: Stack , _: & clap:: ArgMatches , _: & Path ) -> Result < ( ) > {
361
- Err ( anyhow ! (
362
- "StGit not built with support for compressed series"
363
- ) )
364
- }
365
-
366
342
fn import_series (
367
343
stack : Stack ,
368
344
matches : & clap:: ArgMatches ,
@@ -433,7 +409,6 @@ fn import_series(
433
409
Ok ( ( ) )
434
410
}
435
411
436
- #[ cfg( feature = "import-compressed" ) ]
437
412
fn find_series_path ( base : & Path ) -> Result < PathBuf > {
438
413
for entry in base. read_dir ( ) ? {
439
414
let entry = entry?;
@@ -479,32 +454,16 @@ fn import_mail(stack: Stack, matches: &clap::ArgMatches, source_path: Option<&Pa
479
454
Ok ( ( ) )
480
455
}
481
456
482
- #[ cfg( feature = "import-compressed" ) ]
483
457
fn read_gz ( source_file : std:: fs:: File , content : & mut Vec < u8 > ) -> Result < ( ) > {
484
458
flate2:: read:: GzDecoder :: new ( source_file) . read_to_end ( content) ?;
485
459
Ok ( ( ) )
486
460
}
487
461
488
- #[ cfg( not( feature = "import-compressed" ) ) ]
489
- fn read_gz ( _source_file : std:: fs:: File , _content : & mut Vec < u8 > ) -> Result < ( ) > {
490
- Err ( anyhow ! (
491
- "StGit not built with support for compressed patches"
492
- ) )
493
- }
494
-
495
- #[ cfg( feature = "import-compressed" ) ]
496
462
fn read_bz2 ( source_file : std:: fs:: File , content : & mut Vec < u8 > ) -> Result < ( ) > {
497
463
bzip2_rs:: DecoderReader :: new ( source_file) . read_to_end ( content) ?;
498
464
Ok ( ( ) )
499
465
}
500
466
501
- #[ cfg( not( feature = "import-compressed" ) ) ]
502
- fn read_bz2 ( _source_file : std:: fs:: File , _content : & mut Vec < u8 > ) -> Result < ( ) > {
503
- Err ( anyhow ! (
504
- "StGit not built with support for compressed patches"
505
- ) )
506
- }
507
-
508
467
fn import_file < ' repo > (
509
468
stack : Stack < ' repo > ,
510
469
matches : & clap:: ArgMatches ,
0 commit comments