mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 00:34:06 +00:00
auto merge of #14799 : mcreinhard/rust/tilde-fix, r=alexcrichton
Replaced `~Drawable` with `Box<Drawable>` in tutorial
This commit is contained in:
commit
fce98e5262
@ -2459,7 +2459,7 @@ fn draw_all(shapes: &[Box<Drawable>]) {
|
|||||||
}
|
}
|
||||||
~~~~
|
~~~~
|
||||||
|
|
||||||
In this example, there is no type parameter. Instead, the `~Drawable`
|
In this example, there is no type parameter. Instead, the `Box<Drawable>`
|
||||||
type denotes any owned box value that implements the `Drawable` trait.
|
type denotes any owned box value that implements the `Drawable` trait.
|
||||||
To construct such a value, you use the `as` operator to cast a value
|
To construct such a value, you use the `as` operator to cast a value
|
||||||
to an object:
|
to an object:
|
||||||
|
Loading…
Reference in New Issue
Block a user