about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbjorn3 <17426603+bjorn3@users.noreply.github.com>2022-06-14 15:16:51 +0000
committerbjorn3 <17426603+bjorn3@users.noreply.github.com>2022-06-19 12:56:31 +0000
commit73b3ae0b8a5f84a231ec8fa850711ab5d6c027a3 (patch)
tree3187215454263ab8cf87b89f1068f740e45adbf9
parentabb9b60f0965fe1cdc412369219d100022f39273 (diff)
downloadrust-73b3ae0b8a5f84a231ec8fa850711ab5d6c027a3.tar.gz
rust-73b3ae0b8a5f84a231ec8fa850711ab5d6c027a3.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.rs24
1 files changed, 3 insertions, 21 deletions
diff --git a/src/archive.rs b/src/archive.rs
index e9b074e1837..0812f930b5d 100644
--- a/src/archive.rs
+++ b/src/archive.rs
@@ -30,25 +30,7 @@ pub(crate) struct ArArchiveBuilder<'a> {
 }
 
 impl<'a> ArchiveBuilder<'a> for ArArchiveBuilder<'a> {
-    fn new(sess: &'a Session, output: &Path, input: Option<&Path>) -> Self {
-        let (src_archives, entries) = if let Some(input) = input {
-            let read_cache = ReadCache::new(File::open(input).unwrap());
-            let archive = ArchiveFile::parse(&read_cache).unwrap();
-            let mut entries = Vec::new();
-
-            for entry in archive.members() {
-                let entry = entry.unwrap();
-                entries.push((
-                    entry.name().to_vec(),
-                    ArchiveEntry::FromArchive { archive_index: 0, file_range: entry.file_range() },
-                ));
-            }
-
-            (vec![read_cache.into_inner()], entries)
-        } else {
-            (vec![], Vec::new())
-        };
-
+    fn new(sess: &'a Session, output: &Path) -> Self {
         ArArchiveBuilder {
             sess,
             dst: output.to_path_buf(),
@@ -56,8 +38,8 @@ impl<'a> ArchiveBuilder<'a> for ArArchiveBuilder<'a> {
             // FIXME fix builtin ranlib on macOS
             no_builtin_ranlib: sess.target.is_like_osx,
 
-            src_archives,
-            entries,
+            src_archives: vec![],
+            entries: vec![],
         }
     }