♻️ Código revisado con cargo fmt/clippy

This commit is contained in:
Manuel Cillero 2023-02-03 22:42:49 +01:00
parent b02c729864
commit 0ec0f1a961
7 changed files with 25 additions and 14 deletions

View file

@ -6,7 +6,10 @@ pub async fn summary(request: server::HttpRequest) -> ResultPage<Markup, FatalEr
let top_menu = MegaMenu::new()
.with_item(MegaMenuItem::label(l("module_name").as_str()))
.with_item(MegaMenuItem::link("Opción 2", "https://www.google.es"))
.with_item(MegaMenuItem::link_blank("Opción 3", "https://www.google.es"))
.with_item(MegaMenuItem::link_blank(
"Opción 3",
"https://www.google.es",
))
.with_item(MegaMenuItem::submenu(
"Submenú 1",
MegaMenu::new()
@ -25,7 +28,10 @@ pub async fn summary(request: server::HttpRequest) -> ResultPage<Markup, FatalEr
let side_menu = MegaMenu::new()
.with_item(MegaMenuItem::label("Opción 1"))
.with_item(MegaMenuItem::link("Opción 2", "https://www.google.es"))
.with_item(MegaMenuItem::link_blank("Opción 3", "https://www.google.es"))
.with_item(MegaMenuItem::link_blank(
"Opción 3",
"https://www.google.es",
))
.with_item(MegaMenuItem::submenu(
"Submenú 1",
MegaMenu::new()

View file

@ -1,3 +1,3 @@
fn main() -> std::io::Result<()> {
pagetop_build::bundle_resources("./static", "mengamenu", None)
pagetop_build::bundle_resources("./static", "megamenu", None)
}

View file

@ -1,3 +1,5 @@
pub mod saturn;
pub mod menu;
pub mod homepage;

View file

@ -1,5 +1,5 @@
mod module;
pub use module::{BaseModule, ModuleStaticRef, ModuleTrait};
mod definition;
pub use definition::{BaseModule, ModuleStaticRef, ModuleTrait};
mod theme;
pub use theme::{ThemeStaticRef, ThemeTrait};

View file

@ -95,7 +95,10 @@ fn add_to_enabled(list: &mut Vec<ModuleStaticRef>, module: ModuleStaticRef) {
if let Some(theme) = module.theme() {
let mut registered_themes = THEMES.write().unwrap();
if !registered_themes.iter().any(|t| t.handle() == theme.handle()) {
if !registered_themes
.iter()
.any(|t| t.handle() == theme.handle())
{
registered_themes.push(theme);
trace::debug!("Enabling \"{}\" theme", theme.single_name());
}