Rollup merge of #25452 - jimblandy:master, r=steveklabnik
Minor tweak: the text explaining the Borrow trait talks about slices, but the example immediately following just uses a simple reference; there are no slices involved. r? @steveklabnik
This commit is contained in:
commit
fddd89319d
@ -47,9 +47,9 @@ This is because the standard library has `impl Borrow<str> for String`.
|
||||
|
||||
For most types, when you want to take an owned or borrowed type, a `&T` is
|
||||
enough. But one area where `Borrow` is effective is when there’s more than one
|
||||
kind of borrowed value. Slices are an area where this is especially true: you
|
||||
can have both an `&[T]` or a `&mut [T]`. If we wanted to accept both of these
|
||||
types, `Borrow` is up for it:
|
||||
kind of borrowed value. This is especially true of references and slices: you
|
||||
can have both an `&T` or a `&mut T`. If we wanted to accept both of these types,
|
||||
`Borrow` is up for it:
|
||||
|
||||
```
|
||||
use std::borrow::Borrow;
|
||||
|
Loading…
x
Reference in New Issue
Block a user