Commit Graph

40 Commits (51d02c6f94b4f38d5a07a79c3ca20c4eaa3dc690)

Author SHA1 Message Date
Sergey Kletsun 7c97e15988
Update ctor.md
Tiny spelling correction
7 years ago
Nick Cameron f6acf267bf
Merge pull request #48 from llogiq/default
new idiom: Default trait
7 years ago
Dov Murik d4f20a9851
option-iter: Fix typo in `extend` example 7 years ago
Stephen Marsh 6c8bfc0e38 Fix broken link to RAII 7 years ago
Andre Bogus 95c96dd379 fix doc links 8 years ago
Andre Bogus c0b541d6af added derive(new) link 8 years ago
Andre Bogus 65492bc7b2 more default vs. constructor distinction 8 years ago
Andre Bogus ad1c9ee228 lowercase 'constructor' 8 years ago
Andre Bogus 8be913e83c use a configuration-themed example 8 years ago
Andre Bogus 48a41e8eda fix small code mistake 8 years ago
Andre Bogus 964dd9932b Added comment to explain second example 8 years ago
Andre Bogus 53b35444b6 new idiom: Default trait 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
David Henningsson 3bec875bdc Merge remote-tracking branch 'dd/patch-1'
Conflicts:
	idioms/mem-replace.md
8 years ago
Chris Wong 26e27cd307 Merge pull request #32 from xfix/patch-1
Prepending _ to field name avoids unused field warning
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
CasualX 69de2351f2 Fix a few nits with the replace idiom.
Change the match guard to be part of the pattern.

Change `"".to_string()` to a more idiomatic `String::new()` to create a new `String` without memory allocation.
8 years ago
Martin Hoffmann 618a65c337 Mention Option::take() as an alternative to mem::replace() 8 years ago
Konrad Borowski 6af4003b88 Prepending _ to field name avoids unused field warning 8 years ago
Andre Bogus 547ff18605 Adressed comments 8 years ago
Andre Bogus 31b282ad9f new idiom: mem::replace 8 years ago
Nick Cameron 3d748b1adc Merge pull request #25 from lfairy/option-list
Add "Treating Option like a list"
8 years ago
Chris Wong f3fe2d6f28 Iterating over an Option 8 years ago
Mikhail Trishchenkov 1bc8a36a2f Small title fix 8 years ago
Mikhail Trishchenkov 67685cddf0 Rename idiom 8 years ago
Mikhail Trishchenkov 9f85aad151 Fix review issues
Replace tabs with spaces, mention usage for borrowing, add disadvantage
(code indentation increase).
8 years ago
Mikhail Trishchenkov 72606ccfcb Clone to closure idiom 8 years ago
Nick Cameron 6ac851e718 Add the extensibility by privacy pattern
(And change the concatenation pattern to say something different about perf)
9 years ago
Nick Cameron c2cf5e6c1a Deref polymorphism anti-pattern 9 years ago
Nick Cameron a06ca32e70 Merge pull request #15 from liigo/patch-3
improve comment
9 years ago
liigo d4fa321a38 improve comment 9 years ago
liigo ea3aa4d310 fix compile error in comment 9 years ago
Steve Gury 5bc7f3a99c Fix a minor typo s/he/the/ 9 years ago
Nick Cameron 325b642a01 Added a few idioms and patterns - some are still WIP 9 years ago
Nick Cameron cf8479320a Add missing file for concatenating strings 9 years ago
Nick Cameron 65f12dcaab link ctor -> builder 9 years ago
Nick Cameron 248baabc14 Add the constructor idiom. 9 years ago