Fix example in lifetime guide

This rewrites the example to also be more aligned with
the same example given in the main tutorial.