D11397: rust: Switch to the memmap2-rs crate

SimonSapin phabricator at mercurial-scm.org
Fri Sep 10 15:12:26 UTC 2021


SimonSapin created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  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

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D11397

AFFECTED FILES
  rust/Cargo.lock
  rust/hg-core/Cargo.toml
  rust/hg-core/examples/nodemap/index.rs
  rust/hg-core/examples/nodemap/main.rs
  rust/hg-core/src/revlog/nodemap_docket.rs
  rust/hg-core/src/vfs.rs

CHANGE DETAILS

diff --git a/rust/hg-core/src/vfs.rs b/rust/hg-core/src/vfs.rs
--- a/rust/hg-core/src/vfs.rs
+++ b/rust/hg-core/src/vfs.rs
@@ -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};
 
diff --git a/rust/hg-core/src/revlog/nodemap_docket.rs b/rust/hg-core/src/revlog/nodemap_docket.rs
--- a/rust/hg-core/src/revlog/nodemap_docket.rs
+++ b/rust/hg-core/src/revlog/nodemap_docket.rs
@@ -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;
diff --git a/rust/hg-core/examples/nodemap/main.rs b/rust/hg-core/examples/nodemap/main.rs
--- a/rust/hg-core/examples/nodemap/main.rs
+++ b/rust/hg-core/examples/nodemap/main.rs
@@ -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;
diff --git a/rust/hg-core/examples/nodemap/index.rs b/rust/hg-core/examples/nodemap/index.rs
--- a/rust/hg-core/examples/nodemap/index.rs
+++ b/rust/hg-core/examples/nodemap/index.rs
@@ -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;
diff --git a/rust/hg-core/Cargo.toml b/rust/hg-core/Cargo.toml
--- a/rust/hg-core/Cargo.toml
+++ b/rust/hg-core/Cargo.toml
@@ -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"
 
diff --git a/rust/Cargo.lock b/rust/Cargo.lock
--- a/rust/Cargo.lock
+++ b/rust/Cargo.lock
@@ -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]]



To: SimonSapin, #hg-reviewers
Cc: mercurial-patches, mercurial-devel


More information about the Mercurial-devel mailing list