about summary refs log tree commit diff
path: root/src/doc/trpl/traits.md
AgeCommit message (Collapse)AuthorLines
2015-11-19src/doc/trpl -> src/doc/bookSteve Klabnik-527/+0
The book was located under 'src/doc/trpl' because originally, it was going to be hosted under that URL. Late in the game, before 1.0, we decided that /book was a better one, so we changed the output, but not the input. This causes confusion for no good reason. So we'll change the source directory to look like the output directory, like for every other thing in src/doc.
2015-11-02Auto merge of #29505 - rjbs:docs-where-type, r=steveklabnikbors-1/+3
I read this section a few times before even having a guess what was meant, then consulted IRC for confirmation. It may be that I was thick-headed, but I think this is a useful addition.
2015-11-01Attempt to clarify use of `where i32: ConvertTo<T>Ricardo Signes-1/+3
I read this section a few times before even having a guess what was meant, then consulted IRC for confirmation. It may be that I was thick-headed, but I think this is a useful addition.
2015-11-01Replace ok().expect() by Result::expect in trait chapter of trplFlorian Hartwig-2/+2
2015-10-23Define bounds in glossary.mdChris C Cerami-6/+8
2015-10-20Change headers in Traits section of the bookChris C Cerami-2/+2
2015-10-08trpl: link to derivable trait's docspanicbit-9/+9
2015-10-08trpl: mention deriving in traits sectionpanicbit-0/+29
2015-09-03Fix mistake in trait.mdXiao Chuan Yu-1/+1
2015-08-05Rollup merge of #27285 - lastorset:trait-operator-impl, r=steveklabnikSteve Klabnik-7/+67
I also included some smaller trait-related changes. Fixes #26991. r? @shepmaster r? @steveklabnik
2015-07-30Copyedit generics.md and traits.mdLeif Arne Storset-9/+12
Squashed at reviewer's request: Add heading at the end of the introductory material Spice up introductory paragraphs a bit Use quotes instead of <code> for phrase Remove "other" in "other restrictions" (it's not obvious that any other restrictions have been mentioned) "Default methods" is a second-level heading, but is not a subsection of "Where clause" Reword "Default methods" introduction: it's not the "last feature" on this page
2015-07-30Using operator traits in generic structsLeif Arne Storset-0/+6
2015-07-30Show impl<T>Leif Arne Storset-0/+51
This includes a new example with Rectangle, instead of reusing HasArea, because fn area would require the Mul trait, and the added complexity of that would be better left for the Operators and Overloading chapter. Squashed at reviewer's request: Move teaser for trait bounds to bottom
2015-07-25Default methods example: Show "(in)valid" caseLeif Arne Storset-11/+21
Instead of bar/baz, use valid/invalid as default methods. This illustrates why you might want default methods, and shows that you can call other trait methods from a default method.
2015-06-15remove confusing 1i32Steve Klabnik-1/+1
The font can make this hard to read, and we don't even strictly need the annotation, so let's just remove it Fixes #26287
2015-06-13Auto merge of #26118 - tshepang:define-trait, r=steveklabnikbors-0/+3
I saw a variation of this definition in [an article](http://pcwalton.github.io/blog/2012/08/08/a-gentle-introduction-to-traits-in-rust) by @pcwalton.
2015-06-09book: define traitTshepang Lekhonkhobe-0/+3
2015-06-02booK: Float no longer existsTshepang Lekhonkhobe-1/+1
2015-06-02book: update error messageTshepang Lekhonkhobe-1/+1
2015-06-02book: some tiny improvementsTshepang Lekhonkhobe-3/+3
2015-05-29Corrected typo Mathieu David-1/+1
"workd" corrected to "world"
2015-05-27Remove mentions of int / uint from public documentationJake Goulding-1/+1
2015-05-19Rollup merge of #25580 - killercup:trpl/unify-code-blocks, r=steveklabnikManish Goregaokar-4/+4
This adds strictly more information to the source files and reduces the need for customized tooling to render the book. (While this should not change the output of _rustbook_, it is very useful when rendering the sources with external tools like Pandoc.) This only adds the language marker to "first level" code blocks (and not to code blocks in comments inside of code examples). r? @steveklabnik
2015-05-18TRPL: Add `rust` Marker to Some Code BlockPascal Hertleif-4/+4
This adds strictly more information to the source files and reduces the need for customized tooling to render the book. (While this should not change the output of _rustbook_, it is very useful when rendering the sources with external tools like Pandoc.)
2015-05-17Use byte string literal syntaxpeferron-5/+6
The byte string literal syntax `b"whatever"` is more idiomatic than `"whatever".as_bytes()`.
2015-05-16Make error message consistent with source codepeferron-2/+2
The source code uses `"whatever".as_bytes()`, not `b"whatever"`.
2015-05-15trpl: change from "int" to "i32" in TraitsAlex Burka-1/+1
The Traits chapter uses "adding methods to `int`" as an example of "something bad", but there is no such thing as `int` anymore, right? So I changed it to `i32`.
2015-05-07Fix incorrect curly quotesSteve Klabnik-1/+1
2015-04-25A number of spell-checking corrections.Przemysław Wesołek-2/+2
2015-04-21std: Bring back f32::from_str_radix as an unstable APIAlex Crichton-1/+1
This API was exercised in a few tests and mirrors the `from_str_radix` functionality of the integer types.
2015-04-20TRPL edits: traitsSteve Klabnik-188/+100
Let's talk about generics first, since we use traits to bound them in funtions. Partially addresses #24325 Fixes #24271
2015-04-12Updated dead link in Traits chapter of book to point to Trait Objects chapter.Michael Alexander-2/+2
2015-04-06traits.md: Fix example of using traits to match descriptionJosh Triplett-2/+1
traits.md said: If we add a `use` line right above `main` and make the right things public, everything is fine: However, the use line was actually placed at the top of the file instead. Move the use line to right above main. That also makes the example more evocative of cases where the module is defined in a separate file.
2015-03-31Add description of + for multiple trait boundsSteve Klabnik-0/+23
Fixes #23688
2015-03-28book: Fix typo Dan W.-1/+1
r? @steveklabnik
2015-03-23Add #![feature] attributes to doctestsBrian Anderson-0/+6
2015-03-08Add default methods to trait documentationSteve Klabnik-0/+43
2015-02-17Test fixes and rebase conflictsAlex Crichton-1/+1
2015-02-16Document where clauses.Steve Klabnik-0/+90
Closes #21859.
2015-02-09Add documentation on trait objects.Steve Klabnik-45/+2
Largely taken from @huonw's http://huonw.github.io/blog/2015/01/peeking-inside-trait-objects/ Fixes #21707
2015-01-17Intpocalypse, book edition.Steve Klabnik-6/+6
Fix all usage of int/uint/i/u in the book.
2015-01-13Provide example of generic inverse()Steve Klabnik-0/+73
Fixes #17224
2015-01-08Standardize punctuation & formatting of TRPLKevin Yap-3/+3
This commit is an attempt to standardize the use of punctuation and formatting in "The Rust Programming Language" as discussed in #19823. - Convert bold text to italicized textcwhen referring to terminology. - Convert single-quoted text to italicized or double-quoted text, depending on context. - Use double quotes only in the case of scare quotes or quotations.
2015-01-08Fix dead links in the guide and reorganizeAlex Crichton-0/+317