Skip to content

Commit ad9090b

Browse files
committed
feat: v1.9.1
1 parent a42be09 commit ad9090b

File tree

9 files changed

+4
-45
lines changed

9 files changed

+4
-45
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "lombok-macros"
3-
version = "1.9.0"
3+
version = "1.9.1"
44
edition = "2024"
55
authors = ["ltpp-universe <root@ltpp.vip>"]
66
license = "MIT"
@@ -39,4 +39,4 @@ lto = true
3939
panic = "unwind"
4040
debug = false
4141
codegen-units = 1
42-
strip = "debuginfo"
42+
strip = "debuginfo"

readme.md

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -92,50 +92,40 @@ struct LombokTest<'a, 'b, T: Clone + Debug> {
9292
opt_str_lifetime_b: Option<&'b str>,
9393
}
9494
impl<'a, 'b, T: Clone + Debug> LombokTest<'a, 'b, T> {
95-
#[inline]
9695
pub(crate) fn get_list(&self) -> &Vec<String> {
9796
&self.list
9897
}
99-
#[inline]
10098
pub(crate) fn set_list(&mut self, val: Vec<String>) -> &mut Self {
10199
self.list = val;
102100
self
103101
}
104-
#[inline]
105102
pub fn get_mut_list(&mut self) -> &mut Vec<String> {
106103
&mut self.list
107104
}
108-
#[inline]
109105
pub(crate) fn get_opt_str_lifetime_a(&self) -> &Option<&'a T> {
110106
&self.opt_str_lifetime_a
111107
}
112-
#[inline]
113108
pub fn get_mut_opt_str_lifetime_a(&mut self) -> &mut Option<&'a T> {
114109
&mut self.opt_str_lifetime_a
115110
}
116-
#[inline]
117111
pub fn set_opt_str_lifetime_a(&mut self, val: Option<&'a T>) -> &mut Self {
118112
self.opt_str_lifetime_a = val;
119113
self
120114
}
121-
#[inline]
122115
fn set_opt_str_lifetime_b(&mut self, val: Option<&'b str>) -> &mut Self {
123116
self.opt_str_lifetime_b = val;
124117
self
125118
}
126-
#[inline]
127119
pub(crate) fn get_mut_opt_str_lifetime_b(&mut self) -> &mut Option<&'b str> {
128120
&mut self.opt_str_lifetime_b
129121
}
130-
#[inline]
131122
pub fn get_opt_str_lifetime_b(&self) -> &Option<&'b str> {
132123
&self.opt_str_lifetime_b
133124
}
134125
}
135126
#[automatically_derived]
136127
impl<'a, 'b, T: ::core::fmt::Debug + Clone + Debug> ::core::fmt::Debug
137128
for LombokTest<'a, 'b, T> {
138-
#[inline]
139129
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
140130
::core::fmt::Formatter::debug_struct_field3_finish(
141131
f,
@@ -152,7 +142,6 @@ for LombokTest<'a, 'b, T> {
152142
#[automatically_derived]
153143
impl<'a, 'b, T: ::core::clone::Clone + Clone + Debug> ::core::clone::Clone
154144
for LombokTest<'a, 'b, T> {
155-
#[inline]
156145
fn clone(&self) -> LombokTest<'a, 'b, T> {
157146
LombokTest {
158147
list: ::core::clone::Clone::clone(&self.list),
@@ -162,7 +151,6 @@ for LombokTest<'a, 'b, T> {
162151
}
163152
}
164153
impl<'a, 'b, T: Clone + Debug> std::fmt::Display for LombokTest<'a, 'b, T> {
165-
#[inline]
166154
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
167155
f.write_fmt(format_args!("{0:?}", self))
168156
}
@@ -297,50 +285,40 @@ struct LombokTest<'a, 'b, T: Clone + Debug> {
297285
opt_str_lifetime_b: Option<&'b str>,
298286
}
299287
impl<'a, 'b, T: Clone + Debug> LombokTest<'a, 'b, T> {
300-
#[inline]
301288
pub(crate) fn get_list(&self) -> &Vec<String> {
302289
&self.list
303290
}
304-
#[inline]
305291
pub(crate) fn set_list(&mut self, val: Vec<String>) -> &mut Self {
306292
self.list = val;
307293
self
308294
}
309-
#[inline]
310295
pub fn get_mut_list(&mut self) -> &mut Vec<String> {
311296
&mut self.list
312297
}
313-
#[inline]
314298
pub(crate) fn get_opt_str_lifetime_a(&self) -> &Option<&'a T> {
315299
&self.opt_str_lifetime_a
316300
}
317-
#[inline]
318301
pub fn get_mut_opt_str_lifetime_a(&mut self) -> &mut Option<&'a T> {
319302
&mut self.opt_str_lifetime_a
320303
}
321-
#[inline]
322304
pub fn set_opt_str_lifetime_a(&mut self, val: Option<&'a T>) -> &mut Self {
323305
self.opt_str_lifetime_a = val;
324306
self
325307
}
326-
#[inline]
327308
fn set_opt_str_lifetime_b(&mut self, val: Option<&'b str>) -> &mut Self {
328309
self.opt_str_lifetime_b = val;
329310
self
330311
}
331-
#[inline]
332312
pub(crate) fn get_mut_opt_str_lifetime_b(&mut self) -> &mut Option<&'b str> {
333313
&mut self.opt_str_lifetime_b
334314
}
335-
#[inline]
336315
pub fn get_opt_str_lifetime_b(&self) -> &Option<&'b str> {
337316
&self.opt_str_lifetime_b
338317
}
339318
}
340319
#[automatically_derived]
341320
impl<'a, 'b, T: ::core::fmt::Debug + Clone + Debug> ::core::fmt::Debug
342321
for LombokTest<'a, 'b, T> {
343-
#[inline]
344322
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
345323
::core::fmt::Formatter::debug_struct_field3_finish(
346324
f,
@@ -357,7 +335,6 @@ for LombokTest<'a, 'b, T> {
357335
#[automatically_derived]
358336
impl<'a, 'b, T: ::core::clone::Clone + Clone + Debug> ::core::clone::Clone
359337
for LombokTest<'a, 'b, T> {
360-
#[inline]
361338
fn clone(&self) -> LombokTest<'a, 'b, T> {
362339
LombokTest {
363340
list: ::core::clone::Clone::clone(&self.list),
@@ -367,7 +344,6 @@ for LombokTest<'a, 'b, T> {
367344
}
368345
}
369346
impl<'a, 'b, T: Clone + Debug> std::fmt::Display for LombokTest<'a, 'b, T> {
370-
#[inline]
371347
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
372348
f.write_fmt(format_args!("{0:#?}", self))
373349
}

sh/publish.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/bin/bash
2-
cargo publish --allow-dirty;
2+
cargo publish --allow-dirty;

sh/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/bin/bash
2-
cargo test -- --nocapture
2+
cargo test -- --nocapture

src/cfg/impl.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use crate::*;
22

33
impl Default for Cfg {
4-
#[inline]
54
fn default() -> Self {
65
Self {
76
func_type: FuncType::Unknow,

src/func/impl.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ impl FuncType {
2727
///
2828
/// # Returns
2929
/// - `true` if the `FuncType` is `Get`; otherwise, `false`.
30-
#[inline]
3130
pub fn is_get(&self) -> bool {
3231
*self == FuncType::Get
3332
}
@@ -39,7 +38,6 @@ impl FuncType {
3938
///
4039
/// # Returns
4140
/// - `true` if the `FuncType` is `GetMut`; otherwise, `false`.
42-
#[inline]
4341
pub fn is_get_mut(&self) -> bool {
4442
*self == FuncType::GetMut
4543
}
@@ -51,7 +49,6 @@ impl FuncType {
5149
///
5250
/// # Returns
5351
/// - `true` if the `FuncType` is `Set`; otherwise, `false`.
54-
#[inline]
5552
pub fn is_set(&self) -> bool {
5653
*self == FuncType::Set
5754
}
@@ -63,7 +60,6 @@ impl FuncType {
6360
///
6461
/// # Returns
6562
/// - `true` if the `FuncType` is `Unknow`; otherwise, `false`.
66-
#[inline]
6763
pub fn is_unknown(&self) -> bool {
6864
*self == Self::Unknow
6965
}
@@ -75,7 +71,6 @@ impl FuncType {
7571
///
7672
/// # Returns
7773
/// - `true` if the `FuncType` is `Unknow`; otherwise, `false`.
78-
#[inline]
7974
pub fn is_known(func_type_str: &str) -> bool {
8075
let func_type: FuncType = func_type_str.parse::<FuncType>().unwrap_or_default();
8176
func_type != Self::Unknow

src/generate/func.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use crate::*;
77
///
88
/// # Returns
99
/// - A `NewTokenStream` containing the generated getter and setter functions.
10-
#[inline]
1110
pub fn generate_getter_setter(field: &Field) -> NewTokenStream {
1211
let attr_name: String = field
1312
.ident
@@ -28,23 +27,20 @@ pub fn generate_getter_setter(field: &Field) -> NewTokenStream {
2827
}
2928
let get_quote = |vis: NewTokenStream| {
3029
quote! {
31-
#[inline]
3230
#vis fn #get_name(&self) -> &#attr_ty {
3331
&self.#attr_name_ident
3432
}
3533
}
3634
};
3735
let get_mut_quote = |vis: NewTokenStream| {
3836
quote! {
39-
#[inline]
4037
#vis fn #get_mut_name(&mut self) -> &mut #attr_ty {
4138
&mut self.#attr_name_ident
4239
}
4340
}
4441
};
4542
let set_quote = |vis: NewTokenStream| {
4643
quote! {
47-
#[inline]
4844
#vis fn #set_name(&mut self, val: #attr_ty) -> &mut Self {
4945
self.#attr_name_ident = val;
5046
self
@@ -106,7 +102,6 @@ pub fn generate_getter_setter(field: &Field) -> NewTokenStream {
106102
///
107103
/// # Returns
108104
/// - An `OldTokenStream` containing the transformed tokens with `Lombok`-style data code.
109-
#[inline]
110105
pub fn inner_lombok_data(input: OldTokenStream) -> OldTokenStream {
111106
let input: DeriveInput = parse_macro_input!(input as DeriveInput);
112107
let name: &Ident = &input.ident;
@@ -217,7 +212,6 @@ pub(super) fn inner_display(input: OldTokenStream, is_format: bool) -> OldTokenS
217212
let expanded: NewTokenStream = if is_format {
218213
quote! {
219214
impl #impl_generics std::fmt::Display for #name #ty_generics #where_clause {
220-
#[inline]
221215
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
222216
f.write_fmt(format_args!("{0:#?}", self))
223217
}
@@ -226,7 +220,6 @@ pub(super) fn inner_display(input: OldTokenStream, is_format: bool) -> OldTokenS
226220
} else {
227221
quote! {
228222
impl #impl_generics std::fmt::Display for #name #ty_generics #where_clause {
229-
#[inline]
230223
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
231224
f.write_fmt(format_args!("{:?}", self))
232225
}

src/parse/func.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ use crate::*;
88
///
99
/// # Returns
1010
/// - The function does not return a value. It modifies the provided `cfg` in place.
11-
#[inline]
1211
pub fn parse_tokens(tokens: NewTokenStream, cfg: &mut Cfg) {
1312
for token in tokens {
1413
match token {
@@ -45,7 +44,6 @@ pub fn parse_tokens(tokens: NewTokenStream, cfg: &mut Cfg) {
4544
///
4645
/// # Returns
4746
/// - A `Cfg` structure representing the parsed configuration based on the attributes in the token stream.
48-
#[inline]
4947
pub fn analyze_attributes(tokens: NewTokenStream) -> Cfg {
5048
let mut cfg: Cfg = Cfg::default();
5149
parse_tokens(tokens, &mut cfg);

src/visibility/impl.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ impl Visibility {
88
///
99
/// # Returns
1010
/// - A `NewTokenStream` representing the corresponding visibility modifier in Rust syntax.
11-
#[inline]
1211
pub fn to_token_stream(&self) -> NewTokenStream {
1312
match self {
1413
Visibility::Public => quote! { pub },
@@ -25,7 +24,6 @@ impl Visibility {
2524
///
2625
/// # Returns
2726
/// - `true` if the visibility is `Public`; otherwise, `false`.
28-
#[inline]
2927
pub fn is_public(&self) -> bool {
3028
*self == Self::Public
3129
}

0 commit comments

Comments
 (0)