rust: Switch to the memmap2-rs crate
https://github.com/RazrFalcon/memmap2-rs
This is a fork of the original memmap crate which appears to be unmaintained:
https://github.com/danburkert/memmap-rs/issues/90
This fork is the most popular according to https://crates.io/keywords/mmap
Differential Revision: https://phab.mercurial-scm.org/D11397
--- a/rust/Cargo.lock Thu Sep 09 18:07:40 2021 +0200
+++ b/rust/Cargo.lock Fri Sep 10 09:53:09 2021 +0200
@@ -388,7 +388,7 @@
"itertools",
"lazy_static",
"log",
- "memmap",
+ "memmap2",
"micro-timer",
"pretty_assertions",
"rand",
@@ -512,13 +512,12 @@
checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525"
[[package]]
-name = "memmap"
-version = "0.7.0"
+name = "memmap2"
+version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b"
+checksum = "00b6c2ebff6180198788f5db08d7ce3bc1d0b617176678831a7510825973e357"
dependencies = [
"libc",
- "winapi",
]
[[package]]
--- a/rust/hg-core/Cargo.toml Thu Sep 09 18:07:40 2021 +0200
+++ b/rust/hg-core/Cargo.toml Fri Sep 10 09:53:09 2021 +0200
@@ -29,7 +29,7 @@
crossbeam-channel = "0.4"
micro-timer = "0.3.0"
log = "0.4.8"
-memmap = "0.7.0"
+memmap2 = "0.3.1"
zstd = "0.5.3"
format-bytes = "0.2.2"
--- a/rust/hg-core/examples/nodemap/index.rs Thu Sep 09 18:07:40 2021 +0200
+++ b/rust/hg-core/examples/nodemap/index.rs Fri Sep 10 09:53:09 2021 +0200
@@ -5,7 +5,7 @@
//! Minimal `RevlogIndex`, readable from standard Mercurial file format
use hg::*;
-use memmap::*;
+use memmap2::*;
use std::fs::File;
use std::ops::Deref;
use std::path::Path;
--- a/rust/hg-core/examples/nodemap/main.rs Thu Sep 09 18:07:40 2021 +0200
+++ b/rust/hg-core/examples/nodemap/main.rs Fri Sep 10 09:53:09 2021 +0200
@@ -7,7 +7,7 @@
use hg::revlog::node::*;
use hg::revlog::nodemap::*;
use hg::revlog::*;
-use memmap::MmapOptions;
+use memmap2::MmapOptions;
use rand::Rng;
use std::fs::File;
use std::io;
--- a/rust/hg-core/src/revlog/nodemap_docket.rs Thu Sep 09 18:07:40 2021 +0200
+++ b/rust/hg-core/src/revlog/nodemap_docket.rs Fri Sep 10 09:53:09 2021 +0200
@@ -1,7 +1,7 @@
use crate::errors::{HgError, HgResultExt};
use crate::requirements;
use bytes_cast::{unaligned, BytesCast};
-use memmap::Mmap;
+use memmap2::Mmap;
use std::path::{Path, PathBuf};
use super::revlog::RevlogError;
--- a/rust/hg-core/src/vfs.rs Thu Sep 09 18:07:40 2021 +0200
+++ b/rust/hg-core/src/vfs.rs Fri Sep 10 09:53:09 2021 +0200
@@ -1,5 +1,5 @@
use crate::errors::{HgError, IoErrorContext, IoResultExt};
-use memmap::{Mmap, MmapOptions};
+use memmap2::{Mmap, MmapOptions};
use std::io::ErrorKind;
use std::path::{Path, PathBuf};