tokio-rs / bytes

Utilities for working with bytes
MIT License
1.86k stars 278 forks source link

Use ManuallyDrop instead of mem::forget #675

Closed braddunbar closed 5 months ago

braddunbar commented 6 months ago

This change converts several usages of mem::forget to ManuallyDrop as recommended in the docs for mem::forget.

While mem::forget can also be used to transfer memory ownership, doing so is error-prone. ManuallyDrop should be used instead.