diff options
| author | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2022-06-14 15:16:51 +0000 |
|---|---|---|
| committer | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2022-06-19 12:56:31 +0000 |
| commit | 0d28d642b577104bc7901bdf5cae921b47f2442b (patch) | |
| tree | 956a53aeb12276696a967e427b2c8f80552c7420 | |
| parent | 2c7038b860500390d0544972ac040619df9cb424 (diff) | |
| download | rust-0d28d642b577104bc7901bdf5cae921b47f2442b.tar.gz rust-0d28d642b577104bc7901bdf5cae921b47f2442b.zip | |
Remove the source archive functionality of ArchiveWriter
We now build archives through strictly additive means rather than taking an existing archive and potentially substracting parts.
| -rw-r--r-- | src/archive.rs | 28 |
1 files changed, 3 insertions, 25 deletions
diff --git a/src/archive.rs b/src/archive.rs index 999a54495ee..411ec27139e 100644 --- a/src/archive.rs +++ b/src/archive.rs @@ -32,7 +32,7 @@ pub struct ArArchiveBuilder<'a> { } impl<'a> ArchiveBuilder<'a> for ArArchiveBuilder<'a> { - fn new(sess: &'a Session, output: &Path, input: Option<&Path>) -> Self { + fn new(sess: &'a Session, output: &Path) -> Self { let config = ArchiveConfig { sess, dst: output.to_path_buf(), @@ -41,32 +41,10 @@ impl<'a> ArchiveBuilder<'a> for ArArchiveBuilder<'a> { use_gnu_style_archive: sess.target.options.archive_format == "gnu", }; - let (src_archives, entries) = if let Some(input) = input { - let mut archive = ar::Archive::new(File::open(input).unwrap()); - let mut entries = Vec::new(); - - let mut i = 0; - while let Some(entry) = archive.next_entry() { - let entry = entry.unwrap(); - entries.push(( - String::from_utf8(entry.header().identifier().to_vec()).unwrap(), - ArchiveEntry::FromArchive { - archive_index: 0, - entry_index: i, - }, - )); - i += 1; - } - - (vec![(input.to_owned(), archive)], entries) - } else { - (vec![], Vec::new()) - }; - ArArchiveBuilder { config, - src_archives, - entries, + src_archives: vec![], + entries: vec![], } } |
