Skip to content

Commit

Permalink
Replace the unmaintained memmap crate with memmap2 (#300)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielesvelto authored May 11, 2021
1 parent 8ee62e1 commit 0ec88f3
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 8 deletions.
7 changes: 5 additions & 2 deletions Cargo.toml
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
[package]
name = "object"
version = "0.24.0"
authors = ["Nick Fitzgerald <fitzgen@gmail.com>", "Philip Craig <philipjcraig@gmail.com>"]
authors = [
"Nick Fitzgerald <fitzgen@gmail.com>",
"Philip Craig <philipjcraig@gmail.com>",
]
edition = "2018"
exclude = ["/.coveralls.yml", "/.travis.yml"]
keywords = ["object", "elf", "mach-o", "pe", "coff"]
Expand All @@ -26,7 +29,7 @@ compiler_builtins = { version = '0.1.2', optional = true }
alloc = { version = '1.0.0', optional = true, package = 'rustc-std-workspace-alloc' }

[dev-dependencies]
memmap = "0.7"
memmap2 = "0.2.2"

[features]
#=======================================
Expand Down
2 changes: 1 addition & 1 deletion examples/ar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fn main() {
return;
}
};
let file = match unsafe { memmap::Mmap::map(&file) } {
let file = match unsafe { memmap2::Mmap::map(&file) } {
Ok(mmap) => mmap,
Err(err) => {
println!("Failed to map file '{}': {}", file_path, err,);
Expand Down
2 changes: 1 addition & 1 deletion examples/nm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ fn main() {
continue;
}
};
let file = match unsafe { memmap::Mmap::map(&file) } {
let file = match unsafe { memmap2::Mmap::map(&file) } {
Ok(mmap) => mmap,
Err(err) => {
println!("Failed to map file '{}': {}", file_path, err,);
Expand Down
2 changes: 1 addition & 1 deletion examples/objcopy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fn main() {
process::exit(1);
}
};
let in_file = match unsafe { memmap::Mmap::map(&in_file) } {
let in_file = match unsafe { memmap2::Mmap::map(&in_file) } {
Ok(mmap) => mmap,
Err(err) => {
eprintln!("Failed to map file '{}': {}", in_file_path, err,);
Expand Down
2 changes: 1 addition & 1 deletion examples/objdump.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fn main() {
continue;
}
};
let file = match unsafe { memmap::Mmap::map(&file) } {
let file = match unsafe { memmap2::Mmap::map(&file) } {
Ok(mmap) => mmap,
Err(err) => {
println!("Failed to map file '{}': {}", file_path, err,);
Expand Down
2 changes: 1 addition & 1 deletion examples/objectmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fn main() {
process::exit(1);
}
};
let file = match unsafe { memmap::Mmap::map(&file) } {
let file = match unsafe { memmap2::Mmap::map(&file) } {
Ok(mmap) => mmap,
Err(err) => {
println!("Failed to map file '{}': {}", file_path, err,);
Expand Down
2 changes: 1 addition & 1 deletion examples/readobj.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ fn main() {
continue;
}
};
let file = match unsafe { memmap::Mmap::map(&file) } {
let file = match unsafe { memmap2::Mmap::map(&file) } {
Ok(mmap) => mmap,
Err(err) => {
println!("Failed to map file '{}': {}", file_path, err);
Expand Down

0 comments on commit 0ec88f3

Please sign in to comment.