Skip to content

Commit 1895ad2

Browse files
author
moonglum
committed
Clarification of Slice, Vector and Array
Especially in the tutorial beginners should not be confused with wrong terminology. It helps to know the right names for things when you want to find something in the documentation.
1 parent 1001635 commit 1895ad2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/doc/tutorial.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2385,7 +2385,7 @@ fn print_all<T: Printable>(printable_things: ~[T]) {
23852385
Declaring `T` as conforming to the `Printable` trait (as we earlier
23862386
did with `Clone`) makes it possible to call methods from that trait
23872387
on values of type `T` inside the function. It will also cause a
2388-
compile-time error when anyone tries to call `print_all` on an array
2388+
compile-time error when anyone tries to call `print_all` on a vector
23892389
whose element type does not have a `Printable` implementation.
23902390

23912391
Type parameters can have multiple bounds by separating them with `+`,
@@ -2428,9 +2428,9 @@ fn draw_all<T: Drawable>(shapes: ~[T]) {
24282428
# draw_all(~[c]);
24292429
~~~~
24302430

2431-
You can call that on an array of circles, or an array of rectangles
2431+
You can call that on a vector of circles, or a vector of rectangles
24322432
(assuming those have suitable `Drawable` traits defined), but not on
2433-
an array containing both circles and rectangles. When such behavior is
2433+
a vector containing both circles and rectangles. When such behavior is
24342434
needed, a trait name can alternately be used as a type, called
24352435
an _object_.
24362436

0 commit comments

Comments
 (0)