Lifetimes in Structs
⚓ Rust 📅 2026-02-03 👤 surdeus 👁️ 1What is the relation between the Person struct and name (&'a str)? what intuition should one keep in mind in general about references and lifetimes when writing code that deals with them?
pub struct Person<'a> {
name: &'a str,
age: i32,
}
3 posts - 3 participants
🏷️ Rust_feed