Core Advanced
11 Lifetimes
When a function or struct hands out a reference, the compiler needs to know how long it stays valid. Add the annotations that make these compile.
Annotate the Excerpt struct so it can hold a borrowed &str.
Hints
- A struct holding a reference declares one too:
struct Excerpt<'a> { part: &'a str }.
Reveal solution
struct Excerpt<'a> {
part: &'a str,
}