Commit Graph

42 Commits

Author SHA1 Message Date
Neal Ehardt
e8ddd28c23
Update vec.rs path
vec.rs has moved https://github.com/rust-lang/rust/blob/master/src/liballoc/vec.rs

Relevant commit from 2017 eadda7665e (diff-541a0d1eb7d496a1f91ed729f52261ed)
2019-03-05 15:25:54 -06:00
Arnav Borborah
4ab5a61eb5
Fix a slight typo 2018-12-14 15:27:48 -05:00
Sergey Kletsun
7c97e15988
Update ctor.md
Tiny spelling correction
2017-12-26 11:47:39 +02:00
Nick Cameron
f6acf267bf
Merge pull request #48 from llogiq/default
new idiom: Default trait
2017-12-06 15:54:28 +13:00
Dov Murik
d4f20a9851
option-iter: Fix typo in extend example 2017-11-28 11:11:23 +02:00
Stephen Marsh
6c8bfc0e38 Fix broken link to RAII 2017-05-21 20:31:23 -04:00
Andre Bogus
95c96dd379 fix doc links 2017-02-17 05:03:05 +01:00
Andre Bogus
c0b541d6af added derive(new) link 2017-02-16 08:50:43 +01:00
Andre Bogus
65492bc7b2 more default vs. constructor distinction 2017-02-15 18:35:24 +01:00
Andre Bogus
ad1c9ee228 lowercase 'constructor' 2017-02-15 09:16:26 +01:00
Andre Bogus
8be913e83c use a configuration-themed example 2017-02-09 09:10:55 +01:00
Andre Bogus
48a41e8eda fix small code mistake 2017-01-03 06:52:35 +01:00
Andre Bogus
964dd9932b Added comment to explain second example 2017-01-01 05:26:33 +01:00
Andre Bogus
53b35444b6 new idiom: Default trait 2016-12-31 14:56:54 +01:00
Andre Bogus
d827cec092 Add another example to the mem::replace idiom
This fixes #38
2016-12-18 21:24:30 +01:00
diwic
5f484ad473 Change "".to_string() to String::new()
I mistakenly lost this change in my previous pull request, sorry!
2016-10-12 08:50:29 +02:00
Chris Wong
9d955043a4 Merge pull request #33 from partim/take-for-replace
Mention Option::take() as an alternative to mem::replace()
2016-10-10 21:58:42 +13:00
Martin Hoffmann
9fd6a8f9cf Fix language. 2016-10-10 10:52:57 +02:00
David Henningsson
3bec875bdc Merge remote-tracking branch 'dd/patch-1'
Conflicts:
	idioms/mem-replace.md
2016-10-10 08:10:49 +02:00
Chris Wong
26e27cd307 Merge pull request #32 from xfix/patch-1
Prepending _ to field name avoids unused field warning
2016-10-10 09:20:06 +13:00
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)
2016-10-09 19:47:44 +02:00
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.
2016-10-09 15:35:57 +02:00
Martin Hoffmann
618a65c337 Mention Option::take() as an alternative to mem::replace() 2016-10-09 13:39:26 +02:00
Konrad Borowski
6af4003b88 Prepending _ to field name avoids unused field warning 2016-10-09 12:51:01 +02:00
Andre Bogus
547ff18605 Adressed comments 2016-10-08 19:14:05 +02:00
Andre Bogus
31b282ad9f new idiom: mem::replace 2016-10-08 08:51:31 +02:00
Nick Cameron
3d748b1adc Merge pull request #25 from lfairy/option-list
Add "Treating Option like a list"
2016-09-30 09:37:10 +13:00
Chris Wong
f3fe2d6f28 Iterating over an Option 2016-09-29 23:52:13 +13:00
Mikhail Trishchenkov
1bc8a36a2f Small title fix 2016-09-27 16:01:35 +13:00
Mikhail Trishchenkov
67685cddf0 Rename idiom 2016-09-27 16:01:35 +13:00
Mikhail Trishchenkov
9f85aad151 Fix review issues
Replace tabs with spaces, mention usage for borrowing, add disadvantage
(code indentation increase).
2016-09-27 16:01:35 +13:00
Mikhail Trishchenkov
72606ccfcb Clone to closure idiom 2016-09-27 16:01:35 +13:00
Nick Cameron
6ac851e718 Add the extensibility by privacy pattern
(And change the concatenation pattern to say something different about perf)
2015-12-09 10:59:30 +13:00
Nick Cameron
c2cf5e6c1a Deref polymorphism anti-pattern 2015-11-01 21:31:24 -05:00
Nick Cameron
a06ca32e70 Merge pull request #15 from liigo/patch-3
improve comment
2015-10-28 09:13:30 -04:00
liigo
d4fa321a38 improve comment 2015-10-28 09:09:57 +08:00
liigo
ea3aa4d310 fix compile error in comment 2015-10-28 09:04:38 +08:00
Steve Gury
5bc7f3a99c Fix a minor typo s/he/the/ 2015-10-23 09:54:08 -07:00
Nick Cameron
325b642a01 Added a few idioms and patterns - some are still WIP 2015-10-23 09:53:16 +13:00
Nick Cameron
cf8479320a Add missing file for concatenating strings 2015-10-20 09:45:11 +13:00
Nick Cameron
65f12dcaab link ctor -> builder 2015-10-15 15:12:37 +13:00
Nick Cameron
248baabc14 Add the constructor idiom. 2015-08-31 16:24:54 +12:00