diff --git a/pagetop/src/config.rs b/pagetop/src/config.rs index 0a36a0be..860404eb 100644 --- a/pagetop/src/config.rs +++ b/pagetop/src/config.rs @@ -50,7 +50,7 @@ //! serde = { version = "1.0", features = ["derive"] } //! ``` //! -//! Y luego declara con la macro [`pub_config!`](crate::pub_config) tus ajustes, usando tipos +//! Y luego declara con la macro [`define_config!`](crate::define_config) tus ajustes, usando tipos //! seguros y asignando los valores predefinidos para la estructura asociada: //! //! ``` @@ -70,7 +70,7 @@ //! pub height: u16, //! } //! -//! pub_config!(MY_SETTINGS: MySettings, +//! define_config!(MY_SETTINGS: MySettings, //! // [myapp] //! "myapp.name" => "Value Name", //! "myapp.width" => 900, @@ -163,7 +163,7 @@ pub static CONFIG: LazyStatic = LazyStatic::new(|| { /// Detiene la aplicación con un panic! si no pueden asignarse los ajustes de configuración. /// /// Ver [`Cómo añadir ajustes de configuración`](config/index.html#cómo-añadir-ajustes-de-configuración). -macro_rules! pub_config { +macro_rules! define_config { ( $SETTINGS:ident: $Settings:ty $(, $key:literal => $value:literal)*$(,)* ) => { $crate::doc_comment! { concat!( @@ -274,7 +274,7 @@ pub struct Server { pub bind_port: u16, } -pub_config!(SETTINGS: Settings, +define_config!(SETTINGS: Settings, // [app] "app.name" => "PageTop Application", "app.description" => "Developed with the amazing PageTop framework.", diff --git a/pagetop/src/prelude.rs b/pagetop/src/prelude.rs index d76e9ee7..ea91276e 100644 --- a/pagetop/src/prelude.rs +++ b/pagetop/src/prelude.rs @@ -2,7 +2,7 @@ pub use crate::{concat_string, fn_builder, LazyStatic, ResultExt}; // Macros. -pub use crate::{args, paste, pub_config, pub_handle, pub_locale, serve_static_files}; +pub use crate::{args, paste, define_config, pub_handle, pub_locale, serve_static_files}; // Helpers. pub use crate::util;