replace_with icon indicating copy to clipboard operation
replace_with copied to clipboard

Temporarily take ownership of a value at a mutable location, and replace it with a new value based on the old one.

Results 7 replace_with issues
Sort by recently updated
recently updated
newest added

AFAICT, this function doesn't have any additional requirements beyond `replace_with_or_abort_unchecked`, which does not require `std`, so this should be OK to remove.

This isn't a huge deal, but I wanted to point out that the documentation for `no_std` only appears on crates.io and on GitHub. It does not appear on docs.rs. However,...

_Dependabot Preview will be shut down on August 3rd, 2021. In order to keep getting Dependabot updates, please merge this PR and migrate to GitHub-native Dependabot before then._ Dependabot has...

dependencies

Hi, When clicking the link in the README, one comes to this site (no docs exists): https://docs.rs/replace_with/0.1.5/replace_with/fn.replace_with_or_abort_unchecked.html It seems that documentation is not generated for this function, but I have...

In the readme to this package you state: > It's very akin to [`take_mut`](https://github.com/Sgeo/take_mut), though uses `Drop` instead of [`std::panic::catch_unwind()`](https://doc.rust-lang.org/std/panic/fn.catch_unwind.html) to react to unwinding, which avoids the optimisation barrier of...

The two functions: * [`replace_with`](https://docs.rs/replace_with/latest/replace_with/fn.replace_with.html) * [`replace_with_and_return`](https://docs.rs/replace_with/latest/replace_with/fn.replace_with_and_return.html) Both have undefined behavior, since they can cause a double use if the `default` closure provided panics. While the documentation says that `default`...

We can actually check for `panic` being set to `abort` with a built-in [cfg macro](https://doc.rust-lang.org/reference/conditional-compilation.html#panic). I guess this way we can make a safe version of the `replace_with_or_abort_unchecked` function: ```rust...