Continuing the discussion from [Solved] Function taking slice of objects as well as slice of references to objects:
In the example of using AsRef the solution needed to manually implement impl AsRef<Age> for Age:
impl AsRef<Age> for Age {
fn as_ref(&self) -> &Age {
self
}
}
Why this is needed? Can it no be done automatically by the core?
Similar implementation was done in the core mod.rs - source