html
html copied to clipboard
Static Lifetimes
Do the lifetimes for string inputs need to be 'static
? Or can they be shortened to more easily generate HTML code programmatically?
For example:
#![recursion_limit = "512"]
use std::fs;
use html::text_content::Division;
fn div(text: &'static str) -> Division {
Division::builder().text(text).build()
}
fn main() {
let text = fs::read_to_string("./div").unwrap();
println!("{}", div(&text));
}