mirror of
https://github.com/RGBCube/Site
synced 2025-07-31 13:07:46 +00:00
Apply clippy suggestions
This commit is contained in:
parent
9a292fce5b
commit
083de2381a
2 changed files with 3 additions and 3 deletions
|
@ -32,7 +32,7 @@ pub enum Page {
|
|||
}
|
||||
|
||||
impl Page {
|
||||
pub fn as_str(self) -> &'static str {
|
||||
pub fn as_str(&self) -> &'static str {
|
||||
match self {
|
||||
Self::Home => "home",
|
||||
Self::About => "about",
|
||||
|
|
|
@ -54,7 +54,7 @@ pub static PAGES: LazyLock<HashMap<String, (Metadata, Markup)>> = LazyLock::new(
|
|||
log::info!("Adding page {path}");
|
||||
pages.insert(
|
||||
path.to_string().strip_suffix(".md").unwrap().to_string(),
|
||||
(metadata, markdown::parse(&content)),
|
||||
(metadata, markdown::parse(content)),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -63,7 +63,7 @@ pub static PAGES: LazyLock<HashMap<String, (Metadata, Markup)>> = LazyLock::new(
|
|||
|
||||
pub async fn handler(Path(path): Path<String>) -> Markup {
|
||||
if let Some((metadata, body)) = PAGES.get(&path) {
|
||||
text::create(Some(&metadata.title), Page::from_str(&path), &body)
|
||||
text::create(Some(&metadata.title), Page::from_str(&path), body)
|
||||
} else {
|
||||
not_found::handler().await
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue