diff options
author | Brian Anderson <andersrb@gmail.com> | 2012-10-11 21:01:16 -0700 |
---|---|---|
committer | Brian Anderson <andersrb@gmail.com> | 2012-10-11 21:01:16 -0700 |
commit | 39c0d3591e0326874b7263a621ce09ecd64f0eb2 (patch) | |
tree | 81b246ca9e62174e2ebb009fae4a56bd84a23bd9 | |
parent | 91315c3c2f2b07cc090fa9d1a69aa389f3c605c2 (diff) | |
parent | c33bff955707d496d675126433627297487daa25 (diff) |
Merge pull request #3734 from dbp/tutorial-fixesrelease-0.40.4
tutorial: add note about mutability of vectors
-rw-r--r-- | doc/tutorial.md | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/doc/tutorial.md b/doc/tutorial.md index 04fd2aae3f7..12850a92a03 100644 --- a/doc/tutorial.md +++ b/doc/tutorial.md @@ -216,7 +216,7 @@ while count < 10 { Although Rust can almost always infer the types of local variables, you can specify a variable's type by following it with a colon, then the type -name. +name. ~~~~ let monster_size: float = 57.8; @@ -381,6 +381,10 @@ of: `[mut T]` Mutable vector with unknown size ------------------------- ----------------------------------------------- +> ***Note***: In the future, mutability for vectors may be defined by +> the slot that contains the vector, not the type of the vector itself, +> deprecating [mut T] syntax. + In function types, the return type is specified with an arrow, as in the type `fn() -> bool` or the function declaration `fn foo() -> bool { }`. For functions that do not return a meaningful value, you can @@ -1951,7 +1955,7 @@ trait Printable { ~~~~ Traits may be implemented for specific types with [impls]. An impl -that implements a trait includes the name of the trait at the start of +that implements a trait includes the name of the trait at the start of the definition, as in the following impls of `Printable` for `int` and `~str`. |