back: archive: remove dead code

This commit is contained in:
Corey Richardson 2014-04-01 10:16:46 -04:00
parent 5a4c8a9c57
commit 74ddaa27e7
1 changed files with 0 additions and 23 deletions

View File

@ -87,29 +87,6 @@ impl<'a> Archive<'a> {
Archive { sess: sess, dst: dst }
}
/// Read a file in the archive
pub fn read(&self, file: &str) -> Vec<u8> {
// Apparently if "ar p" is used on windows, it generates a corrupt file
// which has bad headers and LLVM will immediately choke on it
if cfg!(windows) {
let loc = TempDir::new("rsar").unwrap();
let archive = os::make_absolute(&self.dst);
run_ar(self.sess, "x", Some(loc.path()), [&archive,
&Path::new(file)]);
let result: Vec<u8> =
fs::File::open(&loc.path().join(file)).read_to_end()
.unwrap()
.move_iter()
.collect();
result
} else {
run_ar(self.sess,
"p",
None,
[&self.dst, &Path::new(file)]).output.move_iter().collect()
}
}
/// Adds all of the contents of a native library to this archive. This will
/// search in the relevant locations for a library named `name`.
pub fn add_native_library(&mut self, name: &str) -> io::IoResult<()> {