Most signatures need no annotation, because three elision rules fill them in. Knowing them tells you exactly when you must write one yourself.
- Every elided input lifetime gets its own distinct parameter.
- If there is exactly one input lifetime, it is assigned to every elided output lifetime.
- If one of the inputs is
&selfor&mut self, its lifetime is assigned to every elided output lifetime.
fn first_word(s: &str) -> &str // rule 2 — one input, no ambiguity
fn rest(&self) -> &str // rule 3 — output borrows from self
