Skip to content

Commit bd229a9

Browse files
chore: replace memoffset with std API
1 parent e4895d3 commit bd229a9

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ libc = { version = "0.2.166", features = ["extra_traits"] }
3232
bitflags = "2.3.3"
3333
cfg-if = "1.0"
3434
pin-utils = { version = "0.1.0", optional = true }
35-
memoffset = { version = "0.9", optional = true }
3635

3736
[features]
3837
default = []
@@ -63,7 +62,7 @@ reboot = []
6362
resource = []
6463
sched = ["process"]
6564
signal = ["process"]
66-
socket = ["memoffset"]
65+
socket = []
6766
syslog = []
6867
term = []
6968
time = []

src/sys/socket/addr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use crate::sys::socket::addr::netlink::NetlinkAddr;
2020
use crate::sys::socket::addr::sys_control::SysControlAddr;
2121
use crate::{NixPath, Result};
2222
use cfg_if::cfg_if;
23-
use memoffset::offset_of;
23+
use std::mem::offset_of;
2424
use std::convert::TryInto;
2525
use std::ffi::OsStr;
2626
use std::hash::{Hash, Hasher};

test/sys/test_ptrace.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
#[cfg(all(
2-
target_os = "linux",
3-
target_env = "gnu",
4-
any(target_arch = "x86_64", target_arch = "x86")
5-
))]
6-
use memoffset::offset_of;
71
use nix::errno::Errno;
82
use nix::sys::ptrace;
93
#[cfg(linux_android)]
@@ -12,6 +6,12 @@ use nix::unistd::getpid;
126

137
#[cfg(linux_android)]
148
use std::mem;
9+
#[cfg(all(
10+
target_os = "linux",
11+
target_env = "gnu",
12+
any(target_arch = "x86_64", target_arch = "x86")
13+
))]
14+
use std::mem::offset_of;
1515

1616
use crate::*;
1717

0 commit comments

Comments
 (0)