From ef3f8baba9b35bcadeb499b1a447050f46bc03f7 Mon Sep 17 00:00:00 2001 From: eastspire Date: Mon, 28 Sep 2026 00:16:22 +0800 Subject: [PATCH 1/3] refactor(type): drop redundant explicit pub from lombok accessor attrs lombok_macros::Visibility defaults to Public, so an accessor attribute that omits visibility already generates a pub accessor. All four fields on Task are themselves pub, so the explicit argument was a no-op in every case. #[get(pub)] -> #[get] #[get_mut(pub)] -> #[get_mut] #[set(pub)] -> #[set] Visibility narrowing is untouched: pub(crate) forms are unaffected, since that is the deliberate restriction path. --- type/src/task/struct.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/type/src/task/struct.rs b/type/src/task/struct.rs index 0688e406..d11c6dba 100644 --- a/type/src/task/struct.rs +++ b/type/src/task/struct.rs @@ -8,23 +8,23 @@ use super::*; #[derive(Clone, CustomDebug, Data, DisplayDebug)] pub struct Task { /// Pool of unbounded senders for distributing tasks to worker threads. - #[get(pub)] - #[get_mut(pub)] - #[set(pub)] + #[get] + #[get_mut] + #[set] pub pool: Vec>, /// Atomic counter for round-robin task distribution across workers. - #[get(pub)] - #[get_mut(pub)] - #[set(pub)] + #[get] + #[get_mut] + #[set] pub counter: Arc, /// Flag indicating whether the task pool should shut down. - #[get(pub)] - #[get_mut(pub)] - #[set(pub)] + #[get] + #[get_mut] + #[set] pub shutdown: Arc, /// Notification handles for precise wake-up of specific workers. - #[get(pub)] - #[get_mut(pub)] - #[set(pub)] + #[get] + #[get_mut] + #[set] pub notifies: Vec>, } From cffb6209de980e138320db08edcd32a41c363caa Mon Sep 17 00:00:00 2001 From: eastspire Date: Mon, 28 Sep 2026 00:20:13 +0800 Subject: [PATCH 2/3] chore: bump version to 21.9.0 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 5ac28275..89067bf4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ categories = ["network-programming", "web-programming"] exclude.workspace = true [workspace.package] -version = "21.8.0" +version = "21.9.0" readme = "README.md" edition = "2024" authors = ["root@ltpp.vip"] From 361a2a82456b9ecfbb967f95d18b982faa9df2c7 Mon Sep 17 00:00:00 2001 From: eastspire Date: Mon, 28 Sep 2026 07:22:40 +0800 Subject: [PATCH 3/3] refactor(type): drop bare lombok accessor attributes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Every accessor-providing derive already emits its accessors for each field, so an argument-less attribute only restates that: #[derive(Data)] -> inner_lombok_data(input, true, true, true) (lombok-macros/src/generate/fn.rs) Drop 23 bare attributes across 3 files. Attributes carrying configuration (type(copy), skip, Into, ...) are untouched, and so are those whose accessor the derive set does not provide — e.g. #[set] on a #[derive(Getter)] struct. Verified by compilation: 491 workspace tests pass, clippy clean, fmt clean. --- core/src/route/struct.rs | 4 ---- type/src/request/struct.rs | 7 ------- type/src/task/struct.rs | 12 ------------ 3 files changed, 23 deletions(-) diff --git a/core/src/route/struct.rs b/core/src/route/struct.rs index d3c14a3e..52caa0e3 100644 --- a/core/src/route/struct.rs +++ b/core/src/route/struct.rs @@ -8,7 +8,6 @@ use super::*; #[derive(Clone, Debug, DisplayDebug, Getter)] pub struct RoutePattern( /// The collection of segments that make up the route pattern. - #[get] pub(super) RouteSegmentList, ); @@ -24,19 +23,16 @@ pub struct RoutePattern( pub struct RouteMatcher { /// A hash map for storing and quickly retrieving handlers for static route. /// These are route without any variable path segments. - #[get] #[set(skip)] #[debug(skip)] pub(super) static_route: ServerHookMap, /// A layered map of dynamic routes grouped by segment count. /// Routes are organized by path segment count for efficient filtering during matching. - #[get] #[set(skip)] #[debug(skip)] pub(super) dynamic_route: ServerHookPatternRoute, /// A layered map of regex routes grouped by segment count. /// Routes with tail regex patterns can match paths with more segments. - #[get] #[set(skip)] #[debug(skip)] pub(super) regex_route: ServerHookPatternRoute, diff --git a/type/src/request/struct.rs b/type/src/request/struct.rs index 55bfb505..8128eaad 100644 --- a/type/src/request/struct.rs +++ b/type/src/request/struct.rs @@ -11,31 +11,24 @@ use super::*; pub struct RequestConfig { /// Buffer size for reading operations. #[get(type(copy))] - #[set] pub buffer_size: usize, /// Maximum size for URL path in bytes. #[get(type(copy))] - #[set] pub max_path_size: usize, /// Maximum number of headers allowed in a request. #[get(type(copy))] - #[set] pub max_header_count: usize, /// Maximum size for a header key in bytes. #[get(type(copy))] - #[set] pub max_header_key_size: usize, /// Maximum size for a header value in bytes. #[get(type(copy))] - #[set] pub max_header_value_size: usize, /// Maximum size for request body in bytes. #[get(type(copy))] - #[set] pub max_body_size: usize, /// Timeout for reading data in milliseconds. #[get(type(copy))] - #[set] pub read_timeout_ms: u64, } diff --git a/type/src/task/struct.rs b/type/src/task/struct.rs index d11c6dba..467fd7b8 100644 --- a/type/src/task/struct.rs +++ b/type/src/task/struct.rs @@ -8,23 +8,11 @@ use super::*; #[derive(Clone, CustomDebug, Data, DisplayDebug)] pub struct Task { /// Pool of unbounded senders for distributing tasks to worker threads. - #[get] - #[get_mut] - #[set] pub pool: Vec>, /// Atomic counter for round-robin task distribution across workers. - #[get] - #[get_mut] - #[set] pub counter: Arc, /// Flag indicating whether the task pool should shut down. - #[get] - #[get_mut] - #[set] pub shutdown: Arc, /// Notification handles for precise wake-up of specific workers. - #[get] - #[get_mut] - #[set] pub notifies: Vec>, }