@@ -50,8 +50,8 @@ impl Mapping {
50
50
/// `zip_offset` should be page-aligned; the dynamic linker
51
51
/// requires this when it loads libraries.
52
52
#[ cfg( target_os = "android" ) ]
53
- pub fn new_android ( path : & Path , zip_offset : Option < i64 > ) -> Option < Mapping > {
54
- fn map_embedded_library ( path : & Path , zip_offset : i64 ) -> Option < Mapping > {
53
+ pub fn new_android ( path : & Path , zip_offset : Option < u64 > ) -> Option < Mapping > {
54
+ fn map_embedded_library ( path : & Path , zip_offset : u64 ) -> Option < Mapping > {
55
55
// get path of ZIP archive (delimited by `!/`)
56
56
let raw_path = path. as_os_str ( ) . as_bytes ( ) ;
57
57
let zip_path = raw_path
@@ -61,12 +61,12 @@ impl Mapping {
61
61
. map ( |( index, _) | Path :: new ( OsStr :: from_bytes ( raw_path. split_at ( index) . 0 ) ) ) ?;
62
62
63
63
let file = fs:: File :: open ( zip_path) . ok ( ) ?;
64
- let len: usize = file. metadata ( ) . ok ( ) ?. len ( ) . try_into ( ) . ok ( ) ? ;
64
+ let len = file. metadata ( ) . ok ( ) ?. len ( ) ;
65
65
66
66
// NOTE: we map the remainder of the entire archive instead of just the library so we don't have to determine its length
67
67
// NOTE: mmap will fail if `zip_offset` is not page-aligned
68
68
let map = unsafe {
69
- super :: mmap:: Mmap :: map ( & file, len - usize:: try_from ( zip_offset) . ok ( ) ?, zip_offset)
69
+ super :: mmap:: Mmap :: map ( & file, usize:: try_from ( len - zip_offset) . ok ( ) ?, zip_offset)
70
70
} ?;
71
71
72
72
Mapping :: mk ( map, |map, stash| {
0 commit comments