I'm not sure if this is an issue or not, but I can't get my head round it.
I have a copy of the first printing, and on page 16, first paragraph we have a couple of sentences explaining that &'a T is covariant in 'a, which I get. But then there is this sentence:
&'a T is also covariant in T, so you can pass a &Vec<&' static str> to a function that takes &Vec<'a str>.
I think I know what the first bit means, but I don't understand how the example relates to it. It shows that &Vec<T> is covariant in T, but that's not obviously the same thing.
Or is T here intended to be Vec<&'a str>? If so, we have two unrelated uses of 'a.
I'm not sure if this is an issue or not, but I can't get my head round it.
I have a copy of the first printing, and on page 16, first paragraph we have a couple of sentences explaining that
&'a Tis covariant in'a, which I get. But then there is this sentence:I think I know what the first bit means, but I don't understand how the example relates to it. It shows that
&Vec<T>is covariant inT, but that's not obviously the same thing.Or is T here intended to be
Vec<&'a str>? If so, we have two unrelated uses of'a.