Skip to content

Commit

Permalink
add migration instructions for safemem (#1909)
Browse files Browse the repository at this point in the history
- as suggested in <#1615 (comment)>
  • Loading branch information
Skgland authored Mar 4, 2024
1 parent 200d7aa commit c4a34bd
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions crates/safemem/RUSTSEC-2023-0081.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,17 @@ patched = []
# safemem is unmaintained

The latest crates.io release was in 2019. The repository has been archived by the author.

## Migration

- `safemem::copy_over(slice, src_idx, dest_idx, len);` can be replaced with `slice.copy_within(src_idx..src_idx+len, dest_idx);` as of `rust 1.37.0`.
- `safemem::write_bytes(slice, byte);` can be replaced with `slice.fill(byte);` as of `rust 1.50.0`
- `safemem::prepend(slice, vec);` can be replaced with

```rust
let old_len = vec.len();
vec.extend_from_slice(slice);
vec.rotate_left(old_len);
```

as of `rust 1.26.0`

0 comments on commit c4a34bd

Please sign in to comment.