Changed requirements for values that implement Into<String>

This commit is contained in:
2025-10-06 22:31:41 +02:00
parent e63edda9ca
commit bcd50d3a17
3 changed files with 105 additions and 48 deletions

View File

@@ -5,7 +5,7 @@ pub(crate) trait Render {
}
pub(crate) struct Page {
title: &'static str,
title: String,
head: Vec<Box<dyn Render>>,
body: Vec<Box<dyn Render>>,
}
@@ -45,9 +45,12 @@ impl Render for Page {
}
impl Page {
pub(crate) fn new(title: &'static str) -> Self {
pub(crate) fn new<T>(title: T) -> Self
where
T: Into<String>,
{
Page {
title,
title: title.into(),
head: vec![],
body: vec![],
}