jorendorff / atomicbox

Safe atomic Box types for Rust
Other
22 stars 11 forks source link

Added a method which swaps with a mutable box reference #1

Closed asajeffrey closed 5 years ago

asajeffrey commented 5 years ago

This adds a ab.swap_mut(r) method, where r: &mut Box<T>. This allows us to swap into a box we've borrowed mutably rather than taken ownership of.