@@ -249,13 +249,13 @@ lazy_static! {
249
249
} ;
250
250
}
251
251
252
- fn allowed_dylibs_for_triple ( triple : & str ) -> Result < & Vec < MachOAllowedDylib > > {
252
+ fn allowed_dylibs_for_triple ( triple : & str ) -> Vec < MachOAllowedDylib > {
253
253
match triple {
254
- "aarch64-apple-darwin" => Ok ( & * DARWIN_ALLOWED_DYLIBS ) ,
255
- "x86_64-apple-darwin" => Ok ( & * DARWIN_ALLOWED_DYLIBS ) ,
256
- "aarch64-apple-ios" => Ok ( & * IOS_ALLOWED_DYLIBS ) ,
257
- "x86_64-apple-ios" => Ok ( & * IOS_ALLOWED_DYLIBS ) ,
258
- _ => Err ( anyhow ! ( "unhandled target triple: {}" , triple ) )
254
+ "aarch64-apple-darwin" => DARWIN_ALLOWED_DYLIBS . clone ( ) ,
255
+ "x86_64-apple-darwin" => DARWIN_ALLOWED_DYLIBS . clone ( ) ,
256
+ "aarch64-apple-ios" => IOS_ALLOWED_DYLIBS . clone ( ) ,
257
+ "x86_64-apple-ios" => IOS_ALLOWED_DYLIBS . clone ( ) ,
258
+ _ => vec ! [ ]
259
259
}
260
260
}
261
261
@@ -330,7 +330,7 @@ fn validate_macho(
330
330
| CommandVariant :: LazyLoadDylib ( command) => {
331
331
let lib = bytes. pread :: < & str > ( load_command. offset + command. dylib . name as usize ) ?;
332
332
333
- let allowed = allowed_dylibs_for_triple ( target_triple) ? ;
333
+ let allowed = allowed_dylibs_for_triple ( target_triple) ;
334
334
335
335
if let Some ( entry) = allowed. iter ( ) . find ( |l| l. name == lib) {
336
336
let load_version =
@@ -429,10 +429,10 @@ fn validate_distribution(dist_path: &Path) -> Result<Vec<String>> {
429
429
}
430
430
}
431
431
432
- let wanted_dylibs = BTreeSet :: from_iter ( allowed_dylibs_for_triple ( triple) ? . iter ( ) . filter ( |d| d. required ) . map ( |d| d. name . clone ( ) ) ) ;
432
+ let wanted_dylibs = BTreeSet :: from_iter ( allowed_dylibs_for_triple ( triple) . iter ( ) . filter ( |d| d. required ) . map ( |d| d. name . clone ( ) ) ) ;
433
433
434
434
for lib in wanted_dylibs. difference ( & seen_dylibs) {
435
- errors. push ( format ! ( "required dylib dependency {} not seen" , lib) ) ;
435
+ errors. push ( format ! ( "required library dependency {} not seen" , lib) ) ;
436
436
}
437
437
438
438
Ok ( errors)
0 commit comments