When and why to use AsRef instead of &T
As you’ve noted, impl AsRef<User> for User seems a little pointless since you can just do &user. You could do impl AsRef<String> for User or impl AsRef<u8> for User as alternatives to &user.email and &user.age but those examples are probably misuses of the trait. What does it mean to be able to convert a User … Read more