rust-unofficial / patterns

A catalogue of Rust design patterns, anti-patterns and idioms
https://rust-unofficial.github.io/patterns/
Mozilla Public License 2.0
8.11k stars 375 forks source link

new idiom: mem::replace #31

Closed llogiq closed 8 years ago

llogiq commented 8 years ago

This is something I recently found to be quite useful.

cbreeden commented 8 years ago

Indeed, this can be quite useful. I like the example a lot. Do you mind adding a link to the table of contents? I can add a note to the clone to satisfy the borrow checker PR, or a new GH issue to remind us to update the relevant links here when that anti-pattern is finished.

llogiq commented 8 years ago

@cbreeden that'd be great.