Commit Graph

53 Commits (46493aa6c1efd819722253255d07504fd91fb08b)

Author SHA1 Message Date
Tom Kaitchuck 46493aa6c1
Update idioms/rustdoc-init.md
Co-authored-by: Ivan Tham <pickfire@riseup.net>
4 years ago
Tom Kaitchuck 87245c7d17
Update idioms/rustdoc-init.md
Co-authored-by: Ivan Tham <pickfire@riseup.net>
4 years ago
Tom Kaitchuck faacbbcf7a Make example more explicet 4 years ago
Tom Kaitchuck 5310b14b62 Add example for #91 4 years ago
Andre Bogus 399c38ee2b New idiom: Out of the Box Dynamic Dispatch 4 years ago
kellerkindt 5ebfc0cdc5
Show call of default() 4 years ago
Kinsey Favre 396ae01fdd
Rewrite mentions of `try!` macro to use `?` operator
The `try!` macro has been [deprecated since Rust 1.39.0][1] in favor of
the `?` operator; update text using it to reflect this.

[1]: https://doc.rust-lang.org/std/macro.try.html
4 years ago
Chris Wong a1a570cb55
Merge pull request #81 from kriomant/temporary-mutability
Temporary mutability idiom
5 years ago
Felix Rabe c6ff9e4bd6
Typo 5 years ago
Mikhail Trishchenkov 8e6bf746ca Reword to be more formal, use 'redefine' instead of 'rebind' 5 years ago
Mikhail Trishchenkov 1b3a31c7c5 Temporary mutability idiom 5 years ago
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)
5 years ago
Arnav Borborah 4ab5a61eb5
Fix a slight typo 6 years ago
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 7 years ago
Andre Bogus c0b541d6af added derive(new) link 7 years ago
Andre Bogus 65492bc7b2 more default vs. constructor distinction 7 years ago
Andre Bogus ad1c9ee228 lowercase 'constructor' 7 years ago
Andre Bogus 8be913e83c use a configuration-themed example 7 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