aboutsummaryrefslogtreecommitdiff
path: root/mingling/src
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-05-24 16:46:45 +0800
committer魏曹先生 <1992414357@qq.com>2026-05-24 16:46:45 +0800
commit11adad7db1b6202d5366527902c3f0a9fb90654f (patch)
tree76ecde96bf98686dfa2d5e9fb00f280794757363 /mingling/src
parent13699cfdccc901c2a7d53270f695384134ba2221 (diff)
Move entry, route, and program_setup macros to extra_macros feature
Remove these macros from the prelude and gate them behind the `extra_macros` feature flag. Update examples and documentation to enable the new feature where these macros are used.
Diffstat (limited to 'mingling/src')
-rw-r--r--mingling/src/example_docs.rs11
-rw-r--r--mingling/src/lib.rs5
2 files changed, 8 insertions, 8 deletions
diff --git a/mingling/src/example_docs.rs b/mingling/src/example_docs.rs
index 70f2856..9a48596 100644
--- a/mingling/src/example_docs.rs
+++ b/mingling/src/example_docs.rs
@@ -31,7 +31,7 @@
/// path = "../../mingling"
///
/// # Enable `parser` features
-/// features = ["parser"]
+/// features = ["parser", "extra_macros"]
/// ```
///
/// Source code (./src/main.rs)
@@ -477,9 +477,7 @@ pub mod example_completion {}
/// [dependencies.mingling]
/// path = "../../mingling"
///
-/// features = [
-/// "parser",
-/// ]
+/// features = ["parser", "extra_macros"]
/// ```
///
/// Source code (./src/main.rs)
@@ -1582,7 +1580,7 @@ pub mod example_resources {}
/// edition = "2024"
///
/// [dependencies]
-/// mingling = { path = "../../mingling" }
+/// mingling = { path = "../../mingling", features = ["extra_macros"] }
/// ```
///
/// Source code (./src/main.rs)
@@ -1634,7 +1632,7 @@ pub mod example_setup {}
/// edition = "2024"
///
/// [dependencies]
-/// mingling = { path = "../../mingling" }
+/// mingling = { path = "../../mingling", features = ["extra_macros"] }
/// ```
///
/// Source code (./src/main.rs)
@@ -1644,6 +1642,7 @@ pub mod example_setup {}
/// #[cfg(test)]
/// mod tests {
/// use super::*;
+/// use mingling::macros::entry;
/// use mingling::{assert_member_id, assert_render_result};
///
/// // --------- IMPORTANT ---------
diff --git a/mingling/src/lib.rs b/mingling/src/lib.rs
index 583c89a..a7d6896 100644
--- a/mingling/src/lib.rs
+++ b/mingling/src/lib.rs
@@ -86,6 +86,7 @@ pub mod macros {
/// Used to create an empty result value for early return from a chain function
pub use mingling_macros::empty_result;
/// Creates a packed entry value from a list of string literals
+ #[cfg(feature = "extra_macros")]
pub use mingling_macros::entry;
/// Used to collect data and create a command-line context
pub use mingling_macros::gen_program;
@@ -103,6 +104,7 @@ pub mod macros {
/// Internal macro for 'gen_program' used to finally generate the program
pub use mingling_macros::program_final_gen;
/// Used to generate program setup
+ #[cfg(feature = "extra_macros")]
pub use mingling_macros::program_setup;
/// Used to print content within a `Renderer` context
pub use mingling_macros::r_print;
@@ -121,6 +123,7 @@ pub mod macros {
/// Used to generate a struct implementing the `Renderer` trait via a method
pub use mingling_macros::renderer;
/// Used to generate a route that either returns a successful result or early returns an error.
+ #[cfg(feature = "extra_macros")]
pub use mingling_macros::route;
#[cfg(feature = "comp")]
/// Used to generate suggestions
@@ -218,8 +221,6 @@ pub mod prelude {
pub use crate::macros::dispatcher;
/// Re-export of the `empty_result` macro for creating an empty result value for early return.
pub use crate::macros::empty_result;
- /// Re-export of the `entry` macro for creating packed entry values from string literals.
- pub use crate::macros::entry;
/// Re-export of the `gen_program` macro for generating the program entry point.
pub use crate::macros::gen_program;
/// Re-export of the `pack` macro for creating wrapper types.