Skip to content

Commit 0d28d64

Browse files
committed
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.
1 parent 2c7038b commit 0d28d64

File tree

1 file changed

+3
-25
lines changed

1 file changed

+3
-25
lines changed

src/archive.rs

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub struct ArArchiveBuilder<'a> {
3232
}
3333

3434
impl<'a> ArchiveBuilder<'a> for ArArchiveBuilder<'a> {
35-
fn new(sess: &'a Session, output: &Path, input: Option<&Path>) -> Self {
35+
fn new(sess: &'a Session, output: &Path) -> Self {
3636
let config = ArchiveConfig {
3737
sess,
3838
dst: output.to_path_buf(),
@@ -41,32 +41,10 @@ impl<'a> ArchiveBuilder<'a> for ArArchiveBuilder<'a> {
4141
use_gnu_style_archive: sess.target.options.archive_format == "gnu",
4242
};
4343

44-
let (src_archives, entries) = if let Some(input) = input {
45-
let mut archive = ar::Archive::new(File::open(input).unwrap());
46-
let mut entries = Vec::new();
47-
48-
let mut i = 0;
49-
while let Some(entry) = archive.next_entry() {
50-
let entry = entry.unwrap();
51-
entries.push((
52-
String::from_utf8(entry.header().identifier().to_vec()).unwrap(),
53-
ArchiveEntry::FromArchive {
54-
archive_index: 0,
55-
entry_index: i,
56-
},
57-
));
58-
i += 1;
59-
}
60-
61-
(vec![(input.to_owned(), archive)], entries)
62-
} else {
63-
(vec![], Vec::new())
64-
};
65-
6644
ArArchiveBuilder {
6745
config,
68-
src_archives,
69-
entries,
46+
src_archives: vec![],
47+
entries: vec![],
7048
}
7149
}
7250

0 commit comments

Comments
 (0)