Skip to content

Commit

Permalink
fix: replace unmaintained safemem with std alternatives
Browse files Browse the repository at this point in the history
  • Loading branch information
Skgland authored Mar 4, 2024
1 parent d2ecc01 commit 73b609d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ readme = "README.md"
edition = "2021"

[dependencies]
safemem = "0.3"
memchr = "2.0"

# `slice_deque` is only supported on platforms with virtual memory
Expand Down
3 changes: 2 additions & 1 deletion src/buffer/std_buf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ impl StdBuf {
// simply move the bytes down to the beginning
let len = self.len();

safemem::copy_over(unsafe { self.buf.as_mut_slice() }, self.pos, 0, len);
let buf_slice = unsafe { self.buf.as_mut_slice() };
buf_slice.copy_within(self.pos..self.pos+len, 0);

self.pos = 0;
self.end = len;
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,7 @@ impl Buffer {
if self.zeroed < cap {
unsafe {
let buf = self.buf.write_buf();
safemem::write_bytes(buf, 0);
buf.fill(0);
}

self.zeroed = cap;
Expand Down

0 comments on commit 73b609d

Please sign in to comment.