Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumRustlifetime annotations on structsSingle-choice MCQ

This struct holds a reference. Which statement about its lifetime parameter is correct?

struct Wrapper<'a> { data: &'a Vec<i32>, } impl<'a> Wrapper<'a> { fn new(v: &'a Vec<i32>) -> Self { Wrapper { data: v } } }