Loading RustViz Engine...
Explain and write functions satisfying all 3 compiler lifetime elision rules.
This problem is currently in blueprint template mode. Once the concept foundation is finalized, live in-browser WebAssembly compilation and test assertion runners will be enabled here.
// Elision Rule 3: If &self or &mut self exists, output lifetime is assigned to self
pub struct Document {
content: String,
}
impl Document {
pub fn first_word(&self) -> &str {
self.content.split_whitespace().next().unwrap_or("")
}
}