# Add \`std::mem::{swap, replace, take}\` to the prelude

**URL:** https://internals.rust-lang.org/t/add-std-swap-replace-take-to-the-prelude/14035
**Category:** libs
**Created:** [February 11, 2021, 9:26pm UTC](https://internals.rust-lang.org/t/add-std-swap-replace-take-to-the-prelude/14035 "2021-02-11T21:26:13Z")
**Posts on this page:** 1
**Showing post:** 9

<div class="post-metadata">

### Author: ![quinedot](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/quinedot/32/7294_2.png) [@quinedot](https://internals.rust-lang.org/u/quinedot)
#### Post date: [February 11, 2021, 11:40pm UTC](https://internals.rust-lang.org/t/add-std-swap-replace-take-to-the-prelude/14035/9 "2021-02-11T23:40:09Z")

</div>

> [@cole-miller](#):
>
> I find myself using `std::mem::{swap, replace, take}` frequently. They're essential parts of the language that (imo) could use more visibility and deserve to be exported somewhere that's less obscure and quicker to name.

Purely anecdotal, but the first time I ended up using `swap` for some sentinel pattern situation, I felt the need to go ask IRC if I was doing something bad or silly. Some combination of not having seen the pattern yet and it being not imported while living beside things like `transmute` and `forget`.

---

_[View the full topic](https://internals.rust-lang.org/t/add-std-swap-replace-take-to-the-prelude/14035)._
