💥 Renombra "pub_config" por "define_config"

This commit is contained in:
Manuel Cillero 2023-05-14 18:46:30 +02:00
parent 05d15b6648
commit c8e444c82a
2 changed files with 5 additions and 5 deletions

View file

@ -50,7 +50,7 @@
//! serde = { version = "1.0", features = ["derive"] } //! 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: //! seguros y asignando los valores predefinidos para la estructura asociada:
//! //!
//! ``` //! ```
@ -70,7 +70,7 @@
//! pub height: u16, //! pub height: u16,
//! } //! }
//! //!
//! pub_config!(MY_SETTINGS: MySettings, //! define_config!(MY_SETTINGS: MySettings,
//! // [myapp] //! // [myapp]
//! "myapp.name" => "Value Name", //! "myapp.name" => "Value Name",
//! "myapp.width" => 900, //! "myapp.width" => 900,
@ -163,7 +163,7 @@ pub static CONFIG: LazyStatic<ConfigData> = LazyStatic::new(|| {
/// Detiene la aplicación con un panic! si no pueden asignarse los ajustes de configuración. /// 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). /// 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)*$(,)* ) => { ( $SETTINGS:ident: $Settings:ty $(, $key:literal => $value:literal)*$(,)* ) => {
$crate::doc_comment! { $crate::doc_comment! {
concat!( concat!(
@ -274,7 +274,7 @@ pub struct Server {
pub bind_port: u16, pub bind_port: u16,
} }
pub_config!(SETTINGS: Settings, define_config!(SETTINGS: Settings,
// [app] // [app]
"app.name" => "PageTop Application", "app.name" => "PageTop Application",
"app.description" => "Developed with the amazing PageTop framework.", "app.description" => "Developed with the amazing PageTop framework.",

View file

@ -2,7 +2,7 @@
pub use crate::{concat_string, fn_builder, LazyStatic, ResultExt}; pub use crate::{concat_string, fn_builder, LazyStatic, ResultExt};
// Macros. // 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. // Helpers.
pub use crate::util; pub use crate::util;