Skip to content

Commit

Permalink
Type parameter removal
Browse files Browse the repository at this point in the history
`Vec<T>` denotes generic type. As this chapter kindly describes Rust generics cannot hold 2 or more struct kinds.
  • Loading branch information
deep-outcome committed Oct 21, 2022
1 parent aa5ee48 commit fdd1d92
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ch17-02-trait-objects.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ collections, using generics and trait bounds is preferable because the
definitions will be monomorphized at compile time to use the concrete types.

On the other hand, with the method using trait objects, one `Screen` instance
can hold a `Vec<T>` that contains a `Box<Button>` as well as a
can hold a `Vec` that contains a `Box<Button>` as well as a
`Box<TextField>`. Let’s look at how this works, and then we’ll talk about the
runtime performance implications.

Expand Down

0 comments on commit fdd1d92

Please sign in to comment.