Commit Graph

9 Commits (46493aa6c1efd819722253255d07504fd91fb08b)

Author SHA1 Message Date
Andre Bogus 964dd9932b Added comment to explain second example 8 years ago
Andre Bogus d827cec092 Add another example to the mem::replace idiom
This fixes #38
8 years ago
diwic 5f484ad473 Change "".to_string() to String::new()
I mistakenly lost this change in my previous pull request, sorry!
8 years ago
Chris Wong 9d955043a4 Merge pull request #33 from partim/take-for-replace
Mention Option::take() as an alternative to mem::replace()
8 years ago
Martin Hoffmann 9fd6a8f9cf Fix language. 8 years ago
diwic 490fb34bb2 Improve mem-replace example
Submitting a PR as suggested by llogiq [here](https://www.reddit.com/r/rust/comments/56l2pk/an_underused_idiom_memreplace_to_avoid_clones/d8kksx6)
8 years ago
Martin Hoffmann 618a65c337 Mention Option::take() as an alternative to mem::replace() 8 years ago
Andre Bogus 547ff18605 Adressed comments 8 years ago
Andre Bogus 31b282ad9f new idiom: mem::replace 8 years ago