@@ -90,11 +90,7 @@ impl<'a> ArchiveBuilder<'a> for LlvmArchiveBuilder<'a> {
90
90
/// Combine the provided files, rlibs, and native libraries into a single
91
91
/// `Archive`.
92
92
fn build ( mut self ) -> bool {
93
- let kind = self . llvm_archive_kind ( ) . unwrap_or_else ( |kind| {
94
- self . sess . fatal ( & format ! ( "Don't know how to build archive of type: {}" , kind) )
95
- } ) ;
96
-
97
- match self . build_with_llvm ( kind) {
93
+ match self . build_with_llvm ( ) {
98
94
Ok ( any_members) => any_members,
99
95
Err ( e) => self . sess . fatal ( & format ! ( "failed to build archive: {}" , e) ) ,
100
96
}
@@ -249,12 +245,12 @@ impl<'a> ArchiveBuilder<'a> for LlvmArchiveBuilder<'a> {
249
245
}
250
246
251
247
impl < ' a > LlvmArchiveBuilder < ' a > {
252
- fn llvm_archive_kind ( & self ) -> Result < ArchiveKind , & str > {
248
+ fn build_with_llvm ( & mut self ) -> io :: Result < bool > {
253
249
let kind = & * self . sess . target . archive_format ;
254
- kind. parse ( ) . map_err ( |_| kind)
255
- }
250
+ let kind = kind. parse :: < ArchiveKind > ( ) . map_err ( |_| kind) . unwrap_or_else ( |kind| {
251
+ self . sess . fatal ( & format ! ( "Don't know how to build archive of type: {}" , kind) )
252
+ } ) ;
256
253
257
- fn build_with_llvm ( & mut self , kind : ArchiveKind ) -> io:: Result < bool > {
258
254
let mut additions = mem:: take ( & mut self . additions ) ;
259
255
let mut strings = Vec :: new ( ) ;
260
256
let mut members = Vec :: new ( ) ;
0 commit comments