@@ -50,8 +50,8 @@ impl Mapping {
5050 /// `zip_offset` should be page-aligned; the dynamic linker
5151 /// requires this when it loads libraries.
5252 #[ 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 > {
5555 // get path of ZIP archive (delimited by `!/`)
5656 let raw_path = path. as_os_str ( ) . as_bytes ( ) ;
5757 let zip_path = raw_path
@@ -61,12 +61,12 @@ impl Mapping {
6161 . map ( |( index, _) | Path :: new ( OsStr :: from_bytes ( raw_path. split_at ( index) . 0 ) ) ) ?;
6262
6363 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 ( ) ;
6565
6666 // NOTE: we map the remainder of the entire archive instead of just the library so we don't have to determine its length
6767 // NOTE: mmap will fail if `zip_offset` is not page-aligned
6868 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)
7070 } ?;
7171
7272 Mapping :: mk ( map, |map, stash| {
0 commit comments