Skip to content

tutorial: add note about mutability of vectors #3734

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 12, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions doc/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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`.

Expand Down