1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
pub struct Label { pub text: String, } impl Label { pub fn new(text: &str) -> Self { Label { text: text.to_string(), } } pub fn render(&self) -> String { format!("{}", self.text) } }