I'm going through the tokio tutorial. Very early on I encountered this line of code:
client.set("hello", "world".into()).await?;
I'm wondering about the "world".into()
part. I know "world"
has the type &str
. My first thought is that the str
type must implement the Into
trait. Maybe it turns the string into an array of bytes. To verify this I went here: str - Rust. Scrolling down the left nav I find the section that lists the traits this type implements, but Into
is not there. Then I looked through the list of methods and into
is not there.
I feel like I'm missing some fundamental understanding about how to read Rust code. What am I missing?