This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -101,22 +101,20 @@ impl<'a> ArchiveBuilder<'a> for ArArchiveBuilder<'a> {
101
101
lto : bool ,
102
102
skip_objects : bool ,
103
103
) -> io:: Result < ( ) > {
104
- let obj_start = name. to_owned ( ) ;
105
-
106
104
self . add_archive ( rlib. to_owned ( ) , move |fname : & str | {
107
105
// Ignore metadata files, no matter the name.
108
106
if fname == METADATA_FILENAME {
109
107
return true ;
110
108
}
111
109
112
110
// Don't include Rust objects if LTO is enabled
113
- if lto && fname. starts_with ( & obj_start ) && fname. ends_with ( ".o" ) {
111
+ if lto && fname. starts_with ( name ) && fname. ends_with ( ".o" ) {
114
112
return true ;
115
113
}
116
114
117
115
// Otherwise if this is *not* a rust object and we're skipping
118
116
// objects then skip this file
119
- if skip_objects && ( !fname. starts_with ( & obj_start ) || !fname. ends_with ( ".o" ) ) {
117
+ if skip_objects && ( !fname. starts_with ( name ) || !fname. ends_with ( ".o" ) ) {
120
118
return true ;
121
119
}
122
120
@@ -271,7 +269,7 @@ impl<'a> ArchiveBuilder<'a> for ArArchiveBuilder<'a> {
271
269
impl < ' a > ArArchiveBuilder < ' a > {
272
270
fn add_archive < F > ( & mut self , archive_path : PathBuf , mut skip : F ) -> io:: Result < ( ) >
273
271
where
274
- F : FnMut ( & str ) -> bool + ' static ,
272
+ F : FnMut ( & str ) -> bool ,
275
273
{
276
274
let read_cache = ReadCache :: new ( std:: fs:: File :: open ( & archive_path) ?) ;
277
275
let archive = ArchiveFile :: parse ( & read_cache) . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments