Skip to content

Commit 366e228

Browse files
committed
Replaced private field with public field of private type
1 parent 88a1379 commit 366e228

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

rorm-macro-impl/src/generate/db_enum.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use crate::MacroConfig;
77
pub fn generate_db_enum(parsed: &ParsedDbEnum, config: &MacroConfig) -> TokenStream {
88
let MacroConfig {
99
rorm_path,
10-
_non_exhaustive: (),
10+
non_exhaustive: _,
1111
} = config;
1212

1313
let ParsedDbEnum {

rorm-macro-impl/src/generate/model.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use crate::MacroConfig;
1212
pub fn generate_model(model: &AnalyzedModel, config: &MacroConfig) -> TokenStream {
1313
let MacroConfig {
1414
rorm_path,
15-
_non_exhaustive: (),
15+
non_exhaustive: _,
1616
} = config;
1717

1818
let (fields_struct_ident, fields_struct) = generate_fields_struct(model, config);
@@ -152,7 +152,7 @@ pub fn generate_model(model: &AnalyzedModel, config: &MacroConfig) -> TokenStrea
152152
fn generate_fields(model: &AnalyzedModel, config: &MacroConfig) -> TokenStream {
153153
let MacroConfig {
154154
rorm_path,
155-
_non_exhaustive: (),
155+
non_exhaustive: _,
156156
} = config;
157157

158158
let mut tokens = TokenStream::new();
@@ -219,7 +219,7 @@ fn generate_field_annotations(
219219
) -> TokenStream {
220220
let MacroConfig {
221221
rorm_path,
222-
_non_exhaustive: (),
222+
non_exhaustive: _,
223223
} = config;
224224

225225
let AnalyzedModelFieldAnnotations {
@@ -317,7 +317,7 @@ fn generate_field_annotations(
317317
fn generate_fields_struct(model: &AnalyzedModel, config: &MacroConfig) -> (Ident, TokenStream) {
318318
let MacroConfig {
319319
rorm_path,
320-
_non_exhaustive: (),
320+
non_exhaustive: _,
321321
} = config;
322322

323323
let vis = &model.vis;

rorm-macro-impl/src/generate/patch.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use crate::MacroConfig;
1010
pub fn generate_patch(patch: &ParsedPatch, config: &MacroConfig) -> TokenStream {
1111
let MacroConfig {
1212
rorm_path,
13-
_non_exhaustive: (),
13+
non_exhaustive: _,
1414
} = config;
1515

1616
let ParsedPatch {
@@ -64,7 +64,7 @@ pub fn partially_generate_patch<'a>(
6464
) -> TokenStream {
6565
let MacroConfig {
6666
rorm_path,
67-
_non_exhaustive: (),
67+
non_exhaustive: _,
6868
} = config;
6969

7070
let value_space_impl = format_ident!("__{patch}_ValueSpaceImpl");

rorm-macro-impl/src/generate/utils.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub fn phantom_data(generics: &Generics) -> TokenStream {
2626
pub fn get_source(span: Span, config: &MacroConfig) -> TokenStream {
2727
let MacroConfig {
2828
rorm_path,
29-
_non_exhaustive: (),
29+
non_exhaustive: _,
3030
} = config;
3131
quote_spanned! {span=>
3232
#rorm_path::internal::hmr::Source {

rorm-macro-impl/src/lib.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,6 @@ pub fn derive_patch(input: TokenStream, config: MacroConfig) -> TokenStream {
4444
///
4545
/// This struct can be useful for other crates wrapping `rorm`'s macros to tweak their behaviour.
4646
#[cfg_attr(doc, non_exhaustive)]
47-
#[expect(
48-
clippy::manual_non_exhaustive,
49-
reason = "non_exhaustive prevents struct literals with `..Default::default()`"
50-
)]
5147
pub struct MacroConfig {
5248
/// Path to the `rorm` crate
5349
///
@@ -58,14 +54,18 @@ pub struct MacroConfig {
5854
pub rorm_path: TokenStream,
5955

6056
#[cfg(not(doc))]
61-
_non_exhaustive: (),
57+
pub non_exhaustive: private::NonExhaustive,
58+
}
59+
60+
mod private {
61+
pub struct NonExhaustive;
6262
}
6363

6464
impl Default for MacroConfig {
6565
fn default() -> Self {
6666
Self {
6767
rorm_path: quote! { ::rorm },
68-
_non_exhaustive: (),
68+
non_exhaustive: private::NonExhaustive,
6969
}
7070
}
7171
}

0 commit comments

Comments
 (0)