From b3771ba87a5af704df6da709f5cf17e6870085a3 Mon Sep 17 00:00:00 2001 From: Tristan Druyen Date: Mon, 14 Apr 2025 16:11:38 +0200 Subject: [PATCH] Improve README.md --- README.md | 1 - src/lib.rs | 9 +-------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/README.md b/README.md index 30963e7..d5f40e1 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,6 @@ Contact me if this doesn't suit your needs. Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later) license, shall be licensed as above, without any additional terms or conditions. - ### Attribution This macro is based on the [build.rs template by @richardanaya](https://github.com/richardanaya/axum-folder-router-htmx) diff --git a/src/lib.rs b/src/lib.rs index 1ef453e..2ef7016 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -104,6 +104,7 @@ //! ### State Extraction //! //! The state type provided to the macro is available in all route handlers: +//! All routes share the same state type, though you can use ```FromRef``` for more granular state extraction. //! //! ```rust //! use axum::{ @@ -122,15 +123,7 @@ //! ## Limitations //! //! - **Compile-time Only**: The routing is determined at compile time, so dynamic route registration isn't supported. -//! - **File I/O**: The macro performs file I/O during compilation, which may have implications in certain build environments. -//! - **Single State Type**: All routes share the same state type, though you can use ```FromRef``` for more granular state extraction. //! -//! ## Best Practices -//! -//! 1. **Consistent Structure**: Maintain a consistent file structure to make your API organization predictable. -//! 2. **Individual Route Files**: Use one ```route.rs``` file per route path for clarity. -//! 3. **Module Organization**: Consider grouping related functionality in directories. -//! 4. **Documentation**: Add comments to each route handler explaining its purpose. use proc_macro::TokenStream; use quote::{format_ident, quote};