Skip to content

Commit c4a34bd

Browse files
authored
add migration instructions for safemem (#1909)
- as suggested in <#1615 (comment)>
1 parent 200d7aa commit c4a34bd

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

crates/safemem/RUSTSEC-2023-0081.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,17 @@ patched = []
1313
# safemem is unmaintained
1414

1515
The latest crates.io release was in 2019. The repository has been archived by the author.
16+
17+
## Migration
18+
19+
- `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`.
20+
- `safemem::write_bytes(slice, byte);` can be replaced with `slice.fill(byte);` as of `rust 1.50.0`
21+
- `safemem::prepend(slice, vec);` can be replaced with
22+
23+
```rust
24+
let old_len = vec.len();
25+
vec.extend_from_slice(slice);
26+
vec.rotate_left(old_len);
27+
```
28+
29+
as of `rust 1.26.0`

0 commit comments

Comments
 (0)