♻️ Código revisado con cargo fmt/clippy
This commit is contained in:
parent
f0e4aea672
commit
9cbf2f8142
10 changed files with 16 additions and 17 deletions
|
|
@ -188,7 +188,7 @@ impl ComponentTrait for MegaMenu {
|
|||
}
|
||||
|
||||
fn before_render(&mut self, rcx: &mut RenderContext) {
|
||||
before_render_inline(self, rcx);
|
||||
run_actions_before_render_component(self, rcx);
|
||||
}
|
||||
|
||||
fn default_render(&self, rcx: &mut RenderContext) -> Markup {
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ impl ComponentTrait for Container {
|
|||
}
|
||||
|
||||
fn before_render(&mut self, rcx: &mut RenderContext) {
|
||||
before_render_inline(self, rcx);
|
||||
run_actions_before_render_component(self, rcx);
|
||||
}
|
||||
|
||||
fn default_render(&self, rcx: &mut RenderContext) -> Markup {
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ impl ComponentTrait for Form {
|
|||
}
|
||||
|
||||
fn before_render(&mut self, rcx: &mut RenderContext) {
|
||||
before_render_inline(self, rcx);
|
||||
run_actions_before_render_component(self, rcx);
|
||||
}
|
||||
|
||||
fn default_render(&self, rcx: &mut RenderContext) -> Markup {
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ impl ComponentTrait for Column {
|
|||
}
|
||||
|
||||
fn before_render(&mut self, rcx: &mut RenderContext) {
|
||||
before_render_inline(self, rcx);
|
||||
run_actions_before_render_component(self, rcx);
|
||||
}
|
||||
|
||||
fn default_render(&self, rcx: &mut RenderContext) -> Markup {
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ impl ComponentTrait for Row {
|
|||
}
|
||||
|
||||
fn before_render(&mut self, rcx: &mut RenderContext) {
|
||||
before_render_inline(self, rcx);
|
||||
run_actions_before_render_component(self, rcx);
|
||||
}
|
||||
|
||||
fn default_render(&self, rcx: &mut RenderContext) -> Markup {
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ itoa = "1.0.6"
|
|||
futures = "0.3.28"
|
||||
futures-util = "0.3.28"
|
||||
nom = "7.1.3"
|
||||
once_cell = "1.17.1"
|
||||
once_cell = "1.17.2"
|
||||
paste = "1.0.12"
|
||||
substring = "1.4.5"
|
||||
term_size = "0.3.2"
|
||||
|
|
@ -51,7 +51,7 @@ tracing = "0.1.37"
|
|||
tracing-appender = "0.2.2"
|
||||
tracing-subscriber = { version = "0.3.17", features = ["json", "env-filter"] }
|
||||
tracing-unwrap = { version = "0.10.0", default-features = false }
|
||||
tracing-actix-web = "0.7.4"
|
||||
tracing-actix-web = "0.7.5"
|
||||
|
||||
fluent-templates = "0.8.0"
|
||||
unic-langid = { version = "0.9.1", features = ["macros"] }
|
||||
|
|
@ -78,7 +78,7 @@ version = "0.11.0"
|
|||
optional = true
|
||||
|
||||
[dev-dependencies]
|
||||
tokio = { version = "1.28.1", features = ["macros", "rt-multi-thread"] }
|
||||
tokio = { version = "1.28.2", features = ["macros", "rt-multi-thread"] }
|
||||
|
||||
[build-dependencies]
|
||||
pagetop-build = { version = "0.0", path = "../pagetop-build" }
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
mod before_render_component;
|
||||
mod before_render_component;
|
||||
|
|
|
|||
|
|
@ -53,7 +53,10 @@ macro_rules! action_before_render_component {
|
|||
}
|
||||
|
||||
#[inline(always)]
|
||||
pub fn before_render_inline(component: &mut $Component, rcx: &mut RenderContext) {
|
||||
pub fn run_actions_before_render_component(
|
||||
component: &mut $Component,
|
||||
rcx: &mut RenderContext
|
||||
) {
|
||||
run_actions($ACTION_HANDLE, |action|
|
||||
action_ref::<[<BeforeRender $Component>]>(&**action)
|
||||
.run(component, rcx)
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ impl ComponentTrait for Block {
|
|||
}
|
||||
|
||||
fn before_render(&mut self, rcx: &mut RenderContext) {
|
||||
before_render_inline(self, rcx);
|
||||
run_actions_before_render_component(self, rcx);
|
||||
}
|
||||
|
||||
fn default_render(&self, rcx: &mut RenderContext) -> Markup {
|
||||
|
|
|
|||
|
|
@ -4,19 +4,15 @@ use std::collections::HashMap;
|
|||
|
||||
define_handle!(COMPONENT_L10N);
|
||||
|
||||
#[derive(Default)]
|
||||
pub enum L10nOp {
|
||||
#[default]
|
||||
None,
|
||||
Value(Markup),
|
||||
Translated(&'static str, &'static Locales),
|
||||
Escaped(&'static str, &'static Locales),
|
||||
}
|
||||
|
||||
impl Default for L10nOp {
|
||||
fn default() -> Self {
|
||||
L10nOp::None
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct L10n {
|
||||
op: L10nOp,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue