From 1e554aac68294a0b0922a56f4d509413226533ba Mon Sep 17 00:00:00 2001 From: Manuel Cillero Date: Wed, 26 Jul 2023 15:03:18 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=A5=20Rename=20create=5Fhandle!()=20to?= =?UTF-8?q?=20new=5Fhandle!()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- drust/src/main.rs | 2 +- examples/basics/hello-name/src/main.rs | 2 +- examples/basics/hello-world/src/main.rs | 2 +- pagetop-admin/src/lib.rs | 2 +- pagetop-aliner/src/lib.rs | 2 +- pagetop-bootsier/src/lib.rs | 2 +- pagetop-bulmix/src/lib.rs | 2 +- pagetop-homedemo/src/lib.rs | 2 +- pagetop-jquery/src/lib.rs | 2 +- pagetop-megamenu/src/component.rs | 4 ++-- pagetop-megamenu/src/lib.rs | 2 +- pagetop-minimal/src/component/anchor.rs | 2 +- pagetop-minimal/src/component/block.rs | 2 +- pagetop-minimal/src/component/container.rs | 2 +- pagetop-minimal/src/component/form_element/button.rs | 2 +- pagetop-minimal/src/component/form_element/date.rs | 2 +- pagetop-minimal/src/component/form_element/form.rs | 2 +- pagetop-minimal/src/component/form_element/hidden.rs | 2 +- pagetop-minimal/src/component/form_element/input.rs | 2 +- pagetop-minimal/src/component/grid/column.rs | 2 +- pagetop-minimal/src/component/grid/row.rs | 2 +- pagetop-minimal/src/component/heading.rs | 2 +- pagetop-minimal/src/component/icon.rs | 2 +- pagetop-minimal/src/component/image.rs | 2 +- pagetop-minimal/src/component/paragraph.rs | 2 +- pagetop-minimal/src/component/poweredby.rs | 2 +- pagetop-minimal/src/lib.rs | 2 +- pagetop-node/src/lib.rs | 2 +- pagetop-user/src/lib.rs | 2 +- pagetop/src/core/component.rs | 4 ++-- pagetop/src/core/component/html.rs | 4 ++-- pagetop/src/core/component/l10n.rs | 4 ++-- pagetop/src/core/theme/default.rs | 4 ++-- pagetop/src/lib.rs | 2 +- pagetop/src/prelude.rs | 2 +- pagetop/src/response/fatal_error/error403.rs | 4 ++-- pagetop/src/response/fatal_error/error404.rs | 4 ++-- pagetop/src/response/page/action/after_prepare_body.rs | 4 ++-- pagetop/src/response/page/action/before_prepare_body.rs | 4 ++-- pagetop/src/util.rs | 2 +- 40 files changed, 49 insertions(+), 49 deletions(-) diff --git a/drust/src/main.rs b/drust/src/main.rs index a6944ba9..306b3c02 100644 --- a/drust/src/main.rs +++ b/drust/src/main.rs @@ -1,6 +1,6 @@ use pagetop::prelude::*; -create_handle!(APP_DRUST); +new_handle!(APP_DRUST); struct Drust; diff --git a/examples/basics/hello-name/src/main.rs b/examples/basics/hello-name/src/main.rs index b95494e4..f5a2d46b 100644 --- a/examples/basics/hello-name/src/main.rs +++ b/examples/basics/hello-name/src/main.rs @@ -1,6 +1,6 @@ use pagetop::prelude::*; -create_handle!(APP_HELLO_NAME); +new_handle!(APP_HELLO_NAME); struct HelloName; diff --git a/examples/basics/hello-world/src/main.rs b/examples/basics/hello-world/src/main.rs index c61d5b47..905d4b76 100644 --- a/examples/basics/hello-world/src/main.rs +++ b/examples/basics/hello-world/src/main.rs @@ -1,6 +1,6 @@ use pagetop::prelude::*; -create_handle!(APP_HELLO_WORLD); +new_handle!(APP_HELLO_WORLD); struct HelloWorld; diff --git a/pagetop-admin/src/lib.rs b/pagetop-admin/src/lib.rs index ed3e8474..351cd7cf 100644 --- a/pagetop-admin/src/lib.rs +++ b/pagetop-admin/src/lib.rs @@ -1,6 +1,6 @@ use pagetop::prelude::*; -create_handle!(MODULE_ADMIN); +new_handle!(MODULE_ADMIN); static_locales!(LOCALES_ADMIN); diff --git a/pagetop-aliner/src/lib.rs b/pagetop-aliner/src/lib.rs index 479ab499..303096ef 100644 --- a/pagetop-aliner/src/lib.rs +++ b/pagetop-aliner/src/lib.rs @@ -1,6 +1,6 @@ use pagetop::prelude::*; -create_handle!(THEME_ALINER); +new_handle!(THEME_ALINER); static_files!(aliner); diff --git a/pagetop-bootsier/src/lib.rs b/pagetop-bootsier/src/lib.rs index f8ce573c..d8067b24 100644 --- a/pagetop-bootsier/src/lib.rs +++ b/pagetop-bootsier/src/lib.rs @@ -1,7 +1,7 @@ use pagetop::prelude::*; use pagetop_jquery::JQuery; -create_handle!(THEME_BOOTSIER); +new_handle!(THEME_BOOTSIER); static_locales!(LOCALES_BOOTSIER); diff --git a/pagetop-bulmix/src/lib.rs b/pagetop-bulmix/src/lib.rs index 0cadab56..4467cdb5 100644 --- a/pagetop-bulmix/src/lib.rs +++ b/pagetop-bulmix/src/lib.rs @@ -2,7 +2,7 @@ use pagetop::prelude::*; use pagetop_jquery::JQuery; use pagetop_minimal::component::*; -create_handle!(THEME_BULMIX); +new_handle!(THEME_BULMIX); static_files!(bulmix); diff --git a/pagetop-homedemo/src/lib.rs b/pagetop-homedemo/src/lib.rs index ae0d8824..79ec44f4 100644 --- a/pagetop-homedemo/src/lib.rs +++ b/pagetop-homedemo/src/lib.rs @@ -1,7 +1,7 @@ use pagetop::prelude::*; use pagetop_minimal::component::*; -create_handle!(MODULE_HOMEDEMO); +new_handle!(MODULE_HOMEDEMO); static_locales!(LOCALES_HOMEDEMO); diff --git a/pagetop-jquery/src/lib.rs b/pagetop-jquery/src/lib.rs index 1af07cd9..efda4aa8 100644 --- a/pagetop-jquery/src/lib.rs +++ b/pagetop-jquery/src/lib.rs @@ -1,6 +1,6 @@ use pagetop::prelude::*; -create_handle!(MODULE_JQUERY); +new_handle!(MODULE_JQUERY); static_locales!(LOCALES_JQUERY); diff --git a/pagetop-megamenu/src/component.rs b/pagetop-megamenu/src/component.rs index 0405f179..07f44038 100644 --- a/pagetop-megamenu/src/component.rs +++ b/pagetop-megamenu/src/component.rs @@ -1,7 +1,7 @@ use pagetop::prelude::*; use pagetop_jquery::JQuery; -create_handle!(COMPONENT_MEGAMENUITEM); +new_handle!(COMPONENT_MEGAMENUITEM); type Label = OneComponent; type Content = OneComponent; @@ -144,7 +144,7 @@ impl MegaMenuItem { // MegaMenu. -create_handle!(COMPONENT_MEGAMENU); +new_handle!(COMPONENT_MEGAMENU); actions_for_component!(MegaMenu); diff --git a/pagetop-megamenu/src/lib.rs b/pagetop-megamenu/src/lib.rs index e93eef75..4afcad4d 100644 --- a/pagetop-megamenu/src/lib.rs +++ b/pagetop-megamenu/src/lib.rs @@ -2,7 +2,7 @@ use pagetop::prelude::*; pub mod component; -create_handle!(MODULE_MEGAMENU); +new_handle!(MODULE_MEGAMENU); static_files!(megamenu); diff --git a/pagetop-minimal/src/component/anchor.rs b/pagetop-minimal/src/component/anchor.rs index b09b3e77..e35d7599 100644 --- a/pagetop-minimal/src/component/anchor.rs +++ b/pagetop-minimal/src/component/anchor.rs @@ -2,7 +2,7 @@ use pagetop::prelude::*; use crate::component::Icon; -create_handle!(COMPONENT_ANCHOR); +new_handle!(COMPONENT_ANCHOR); #[derive(Default)] pub enum AnchorType { diff --git a/pagetop-minimal/src/component/block.rs b/pagetop-minimal/src/component/block.rs index 26de537f..823bf2b3 100644 --- a/pagetop-minimal/src/component/block.rs +++ b/pagetop-minimal/src/component/block.rs @@ -1,6 +1,6 @@ use pagetop::prelude::*; -create_handle!(COMPONENT_BLOCK); +new_handle!(COMPONENT_BLOCK); actions_for_component!(Block); diff --git a/pagetop-minimal/src/component/container.rs b/pagetop-minimal/src/component/container.rs index 8e954974..67164b88 100644 --- a/pagetop-minimal/src/component/container.rs +++ b/pagetop-minimal/src/component/container.rs @@ -1,6 +1,6 @@ use pagetop::prelude::*; -create_handle!(COMPONENT_CONTAINER); +new_handle!(COMPONENT_CONTAINER); actions_for_component!(Container); diff --git a/pagetop-minimal/src/component/form_element/button.rs b/pagetop-minimal/src/component/form_element/button.rs index df0130fe..1ccd670e 100644 --- a/pagetop-minimal/src/component/form_element/button.rs +++ b/pagetop-minimal/src/component/form_element/button.rs @@ -1,6 +1,6 @@ use pagetop::prelude::*; -create_handle!(COMPONENT_BUTTON); +new_handle!(COMPONENT_BUTTON); #[derive(Default)] pub enum ButtonType { diff --git a/pagetop-minimal/src/component/form_element/date.rs b/pagetop-minimal/src/component/form_element/date.rs index 81e928fb..0bccb47d 100644 --- a/pagetop-minimal/src/component/form_element/date.rs +++ b/pagetop-minimal/src/component/form_element/date.rs @@ -1,6 +1,6 @@ use pagetop::prelude::*; -create_handle!(COMPONENT_DATE); +new_handle!(COMPONENT_DATE); #[rustfmt::skip] #[derive(Default)] diff --git a/pagetop-minimal/src/component/form_element/form.rs b/pagetop-minimal/src/component/form_element/form.rs index ba12e070..d3e2f2fb 100644 --- a/pagetop-minimal/src/component/form_element/form.rs +++ b/pagetop-minimal/src/component/form_element/form.rs @@ -1,6 +1,6 @@ use pagetop::prelude::*; -create_handle!(COMPONENT_FORM); +new_handle!(COMPONENT_FORM); actions_for_component!(Form); diff --git a/pagetop-minimal/src/component/form_element/hidden.rs b/pagetop-minimal/src/component/form_element/hidden.rs index 925f143c..9aeeeed3 100644 --- a/pagetop-minimal/src/component/form_element/hidden.rs +++ b/pagetop-minimal/src/component/form_element/hidden.rs @@ -1,6 +1,6 @@ use pagetop::prelude::*; -create_handle!(COMPONENT_HIDDEN); +new_handle!(COMPONENT_HIDDEN); #[rustfmt::skip] #[derive(Default)] diff --git a/pagetop-minimal/src/component/form_element/input.rs b/pagetop-minimal/src/component/form_element/input.rs index af6ab03b..c50c15d2 100644 --- a/pagetop-minimal/src/component/form_element/input.rs +++ b/pagetop-minimal/src/component/form_element/input.rs @@ -1,6 +1,6 @@ use pagetop::prelude::*; -create_handle!(COMPONENT_INPUT); +new_handle!(COMPONENT_INPUT); #[derive(Default)] pub enum InputType { diff --git a/pagetop-minimal/src/component/grid/column.rs b/pagetop-minimal/src/component/grid/column.rs index b9c9e3a8..ec747ac1 100644 --- a/pagetop-minimal/src/component/grid/column.rs +++ b/pagetop-minimal/src/component/grid/column.rs @@ -1,6 +1,6 @@ use pagetop::prelude::*; -create_handle!(COMPONENT_COLUMN); +new_handle!(COMPONENT_COLUMN); actions_for_component!(Column); diff --git a/pagetop-minimal/src/component/grid/row.rs b/pagetop-minimal/src/component/grid/row.rs index 4138d77b..f150bbc2 100644 --- a/pagetop-minimal/src/component/grid/row.rs +++ b/pagetop-minimal/src/component/grid/row.rs @@ -2,7 +2,7 @@ use pagetop::prelude::*; use crate::component::grid; -create_handle!(COMPONENT_ROW); +new_handle!(COMPONENT_ROW); actions_for_component!(Row); diff --git a/pagetop-minimal/src/component/heading.rs b/pagetop-minimal/src/component/heading.rs index 8e4de53f..dd5444dc 100644 --- a/pagetop-minimal/src/component/heading.rs +++ b/pagetop-minimal/src/component/heading.rs @@ -1,6 +1,6 @@ use pagetop::prelude::*; -create_handle!(COMPONENT_HEADING); +new_handle!(COMPONENT_HEADING); #[derive(Default)] pub enum HeadingType { diff --git a/pagetop-minimal/src/component/icon.rs b/pagetop-minimal/src/component/icon.rs index 2a77b600..081be948 100644 --- a/pagetop-minimal/src/component/icon.rs +++ b/pagetop-minimal/src/component/icon.rs @@ -1,6 +1,6 @@ use pagetop::prelude::*; -create_handle!(COMPONENT_ICON); +new_handle!(COMPONENT_ICON); #[rustfmt::skip] #[derive(Default)] diff --git a/pagetop-minimal/src/component/image.rs b/pagetop-minimal/src/component/image.rs index 72d7b351..dee86745 100644 --- a/pagetop-minimal/src/component/image.rs +++ b/pagetop-minimal/src/component/image.rs @@ -1,6 +1,6 @@ use pagetop::prelude::*; -create_handle!(COMPONENT_IMAGE); +new_handle!(COMPONENT_IMAGE); #[rustfmt::skip] #[derive(Default)] diff --git a/pagetop-minimal/src/component/paragraph.rs b/pagetop-minimal/src/component/paragraph.rs index c5d0716f..09e85ddb 100644 --- a/pagetop-minimal/src/component/paragraph.rs +++ b/pagetop-minimal/src/component/paragraph.rs @@ -1,6 +1,6 @@ use pagetop::prelude::*; -create_handle!(COMPONENT_PARAGRAPH); +new_handle!(COMPONENT_PARAGRAPH); #[derive(Default)] pub enum ParagraphDisplay { diff --git a/pagetop-minimal/src/component/poweredby.rs b/pagetop-minimal/src/component/poweredby.rs index 0328a06c..6069f8c2 100644 --- a/pagetop-minimal/src/component/poweredby.rs +++ b/pagetop-minimal/src/component/poweredby.rs @@ -2,7 +2,7 @@ use crate::{Minimal, LOCALES_MINIMAL}; use pagetop::prelude::*; -create_handle!(COMPONENT_POWEREDBY); +new_handle!(COMPONENT_POWEREDBY); #[derive(Default, Eq, PartialEq)] pub enum PoweredByLogo { diff --git a/pagetop-minimal/src/lib.rs b/pagetop-minimal/src/lib.rs index 5be4cc75..99965875 100644 --- a/pagetop-minimal/src/lib.rs +++ b/pagetop-minimal/src/lib.rs @@ -2,7 +2,7 @@ use pagetop::prelude::*; pub mod component; -create_handle!(MODULE_MINIMAL); +new_handle!(MODULE_MINIMAL); static_locales!(LOCALES_MINIMAL); diff --git a/pagetop-node/src/lib.rs b/pagetop-node/src/lib.rs index ffe40c72..c83f71d1 100644 --- a/pagetop-node/src/lib.rs +++ b/pagetop-node/src/lib.rs @@ -1,6 +1,6 @@ use pagetop::prelude::*; -create_handle!(MODULE_NODE); +new_handle!(MODULE_NODE); static_locales!(LOCALES_NODE); diff --git a/pagetop-user/src/lib.rs b/pagetop-user/src/lib.rs index 60384843..7ec57e4c 100644 --- a/pagetop-user/src/lib.rs +++ b/pagetop-user/src/lib.rs @@ -1,7 +1,7 @@ use pagetop::prelude::*; use pagetop_minimal::component::*; -create_handle!(MODULE_USER); +new_handle!(MODULE_USER); static_locales!(LOCALES_USER); diff --git a/pagetop/src/core/component.rs b/pagetop/src/core/component.rs index 615a6cca..833aa16c 100644 --- a/pagetop/src/core/component.rs +++ b/pagetop/src/core/component.rs @@ -28,7 +28,7 @@ macro_rules! actions_for_component { // ACTION BEFORE PREPARE COMPONENT // ************************************************************************************* - $crate::create_handle!([] for Action); + $crate::new_handle!([] for Action); pub struct [] { action: Option<[]>, @@ -87,7 +87,7 @@ macro_rules! actions_for_component { // ACTION AFTER PREPARE COMPONENT // ************************************************************************************* - $crate::create_handle!([] for Action); + $crate::new_handle!([] for Action); pub struct [] { action: Option<[]>, diff --git a/pagetop/src/core/component/html.rs b/pagetop/src/core/component/html.rs index 8cf0d5a3..2b8a7241 100644 --- a/pagetop/src/core/component/html.rs +++ b/pagetop/src/core/component/html.rs @@ -1,8 +1,8 @@ use crate::core::component::{ComponentTrait, Context}; use crate::html::{html, Markup, PrepareMarkup}; -use crate::{create_handle, fn_builder, Handle}; +use crate::{fn_builder, new_handle, Handle}; -create_handle!(COMPONENT_HTML); +new_handle!(COMPONENT_HTML); #[derive(Default)] pub struct Html(Markup); diff --git a/pagetop/src/core/component/l10n.rs b/pagetop/src/core/component/l10n.rs index d014dea7..dcde3362 100644 --- a/pagetop/src/core/component/l10n.rs +++ b/pagetop/src/core/component/l10n.rs @@ -1,11 +1,11 @@ use crate::core::component::{ComponentTrait, Context}; use crate::html::{html, PreEscaped, PrepareMarkup}; use crate::locale::{Loader, Locales}; -use crate::{create_handle, fn_builder, Handle}; +use crate::{fn_builder, new_handle, Handle}; use std::collections::HashMap; -create_handle!(COMPONENT_L10N); +new_handle!(COMPONENT_L10N); #[derive(Default)] pub enum L10nOp { diff --git a/pagetop/src/core/theme/default.rs b/pagetop/src/core/theme/default.rs index 059e8f40..523fab9e 100644 --- a/pagetop/src/core/theme/default.rs +++ b/pagetop/src/core/theme/default.rs @@ -4,9 +4,9 @@ use crate::core::theme::{ThemeRef, ThemeTrait}; use crate::html::{Favicon, StyleSheet}; use crate::response::page::Page; use crate::service; -use crate::{create_handle, serve_static_files, static_files, Handle}; +use crate::{new_handle, serve_static_files, static_files, Handle}; -create_handle!(THEME_DEFAULT); +new_handle!(THEME_DEFAULT); static_files!(theme); diff --git a/pagetop/src/lib.rs b/pagetop/src/lib.rs index 96507a3a..e9186e64 100644 --- a/pagetop/src/lib.rs +++ b/pagetop/src/lib.rs @@ -44,7 +44,7 @@ //! ```rust //! use pagetop::prelude::*; //! -//! create_handle!(APP_HELLO_WORLD); +//! new_handle!(APP_HELLO_WORLD); //! //! struct HelloWorld; //! diff --git a/pagetop/src/prelude.rs b/pagetop/src/prelude.rs index c6c62f7a..abc19629 100644 --- a/pagetop/src/prelude.rs +++ b/pagetop/src/prelude.rs @@ -9,7 +9,7 @@ pub use crate::{Handle, HashMapResources, LazyStatic, ResultExt, Weight}; // Funciones y macros Ăștiles. pub use crate::util; pub use crate::{action, actions_for_component}; -pub use crate::{create_handle, default_settings, kv}; +pub use crate::{default_settings, kv, new_handle}; pub use crate::{serve_static_files, static_files, static_locales}; // API. diff --git a/pagetop/src/response/fatal_error/error403.rs b/pagetop/src/response/fatal_error/error403.rs index 376234c2..d21e3b23 100644 --- a/pagetop/src/response/fatal_error/error403.rs +++ b/pagetop/src/response/fatal_error/error403.rs @@ -1,8 +1,8 @@ use crate::core::component::{ComponentTrait, Context}; use crate::html::{html, PrepareMarkup}; -use crate::{create_handle, Handle}; +use crate::{new_handle, Handle}; -create_handle!(ERROR_403); +new_handle!(ERROR_403); pub struct Error403; diff --git a/pagetop/src/response/fatal_error/error404.rs b/pagetop/src/response/fatal_error/error404.rs index c9c9051d..e1f7827b 100644 --- a/pagetop/src/response/fatal_error/error404.rs +++ b/pagetop/src/response/fatal_error/error404.rs @@ -1,8 +1,8 @@ use crate::core::component::{ComponentTrait, Context}; use crate::html::{html, PrepareMarkup}; -use crate::{create_handle, Handle}; +use crate::{new_handle, Handle}; -create_handle!(ERROR_404); +new_handle!(ERROR_404); pub struct Error404; diff --git a/pagetop/src/response/page/action/after_prepare_body.rs b/pagetop/src/response/page/action/after_prepare_body.rs index 719d7752..ff74cedc 100644 --- a/pagetop/src/response/page/action/after_prepare_body.rs +++ b/pagetop/src/response/page/action/after_prepare_body.rs @@ -1,9 +1,9 @@ use crate::core::action::{action_ref, run_actions, ActionTrait}; use crate::response::page::action::ActionPage; use crate::response::page::Page; -use crate::{create_handle, Handle, Weight}; +use crate::{new_handle, Handle, Weight}; -create_handle!(ACTION_AFTER_PREPARE_BODY for Action); +new_handle!(ACTION_AFTER_PREPARE_BODY for Action); pub struct ActionAfterPrepareBody { action: Option, diff --git a/pagetop/src/response/page/action/before_prepare_body.rs b/pagetop/src/response/page/action/before_prepare_body.rs index 0c8d7907..715d8378 100644 --- a/pagetop/src/response/page/action/before_prepare_body.rs +++ b/pagetop/src/response/page/action/before_prepare_body.rs @@ -1,9 +1,9 @@ use crate::core::action::{action_ref, run_actions, ActionTrait}; use crate::response::page::action::ActionPage; use crate::response::page::Page; -use crate::{create_handle, Handle, Weight}; +use crate::{new_handle, Handle, Weight}; -create_handle!(ACTION_BEFORE_PREPARE_BODY for Action); +new_handle!(ACTION_BEFORE_PREPARE_BODY for Action); pub struct ActionBeforePrepareBody { action: Option, diff --git a/pagetop/src/util.rs b/pagetop/src/util.rs index e2c47536..89a38392 100644 --- a/pagetop/src/util.rs +++ b/pagetop/src/util.rs @@ -106,7 +106,7 @@ macro_rules! default_settings { } #[macro_export] -macro_rules! create_handle { +macro_rules! new_handle { ( $HANDLE:ident ) => { /// Public constant handle to represent a unique PageTop building element. pub const $HANDLE: $crate::Handle =