Practice question from rust life time practice advanced
In a method definition, what implicitly declares the lifetime of the first reference parameter?
impl<'a> MyStruct<'a> {
fn method(&____) -> &str {
// Implementation
}
}Answer
self
Explanation
Using &self implicitly declares the lifetime of the first reference parameter in method definitions.