Skip to content

Commit 6e68c93

Browse files
committed
style(ast_tools): reorder imports (#6904)
Pure refactor. Re-order imports for clarity.
1 parent 45333bc commit 6e68c93

File tree

17 files changed

+35
-17
lines changed

17 files changed

+35
-17
lines changed

tasks/ast_tools/src/derives/clone_in.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ use proc_macro2::TokenStream;
33
use quote::{format_ident, quote};
44
use syn::Ident;
55

6-
use super::{define_derive, Derive};
76
use crate::{
87
codegen::LateCtx,
98
markers::CloneInAttribute,
109
schema::{EnumDef, GetIdent, StructDef, TypeDef},
1110
};
1211

12+
use super::{define_derive, Derive};
13+
1314
pub struct DeriveCloneIn;
1415

1516
define_derive!(DeriveCloneIn);

tasks/ast_tools/src/derives/content_eq.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@ use itertools::Itertools;
22
use proc_macro2::TokenStream;
33
use quote::quote;
44

5-
use super::{define_derive, Derive};
65
use crate::{
76
codegen::LateCtx,
87
schema::{EnumDef, GetGenerics, StructDef, ToType, TypeDef},
98
util::ToIdent,
109
};
1110

11+
use super::{define_derive, Derive};
12+
1213
pub struct DeriveContentEq;
1314

1415
define_derive!(DeriveContentEq);

tasks/ast_tools/src/derives/content_hash.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@ use itertools::Itertools;
22
use proc_macro2::TokenStream;
33
use quote::quote;
44

5-
use super::{define_derive, Derive};
65
use crate::{
76
codegen::LateCtx,
87
schema::{EnumDef, GetGenerics, StructDef, ToType, TypeDef},
98
util::ToIdent,
109
};
1110

11+
use super::{define_derive, Derive};
12+
1213
pub struct DeriveContentHash;
1314

1415
define_derive!(DeriveContentHash);

tasks/ast_tools/src/derives/estree.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ use convert_case::{Case, Casing};
22
use proc_macro2::TokenStream;
33
use quote::quote;
44

5-
use super::{define_derive, Derive};
65
use crate::{
76
codegen::LateCtx,
87
markers::ESTreeStructAttribute,
@@ -12,6 +11,8 @@ use crate::{
1211
},
1312
};
1413

14+
use super::{define_derive, Derive};
15+
1516
pub struct DeriveESTree;
1617

1718
define_derive!(DeriveESTree);

tasks/ast_tools/src/derives/get_span.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@ use proc_macro2::TokenStream;
22
use quote::quote;
33
use syn::Ident;
44

5-
use super::{define_derive, Derive};
65
use crate::{
76
codegen::LateCtx,
87
schema::{EnumDef, GetGenerics, StructDef, ToType, TypeDef},
98
util::{ToIdent, TypeWrapper},
109
};
1110

11+
use super::{define_derive, Derive};
12+
1213
pub struct DeriveGetSpan;
1314

1415
define_derive!(DeriveGetSpan);

tasks/ast_tools/src/generators/assert_layouts.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ use proc_macro2::TokenStream;
22
use quote::quote;
33
use syn::Type;
44

5-
use super::define_generator;
65
use crate::{
76
codegen::LateCtx,
87
output::{output_path, Output},
@@ -11,6 +10,8 @@ use crate::{
1110
Generator,
1211
};
1312

13+
use super::define_generator;
14+
1415
pub struct AssertLayouts;
1516

1617
define_generator!(AssertLayouts);

tasks/ast_tools/src/generators/ast_builder.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ use quote::{format_ident, quote, ToTokens};
88
use rustc_hash::FxHashMap;
99
use syn::{parse_quote, Ident, Type};
1010

11-
use super::define_generator;
1211
use crate::{
1312
codegen::LateCtx,
1413
output::{output_path, Output},
@@ -19,6 +18,8 @@ use crate::{
1918
Generator,
2019
};
2120

21+
use super::define_generator;
22+
2223
pub struct AstBuilderGenerator;
2324

2425
define_generator!(AstBuilderGenerator);

tasks/ast_tools/src/generators/ast_kind.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@ use itertools::Itertools;
33
use quote::{format_ident, quote};
44
use syn::{parse_quote, Arm, ImplItemFn, Variant};
55

6-
use super::define_generator;
76
use crate::{
87
codegen::LateCtx,
98
output::{output_path, Output},
109
schema::{GetIdent, ToType},
1110
Generator,
1211
};
1312

13+
use super::define_generator;
14+
1415
pub struct AstKindGenerator;
1516

1617
define_generator!(AstKindGenerator);

tasks/ast_tools/src/generators/typescript.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use convert_case::{Case, Casing};
22
use itertools::Itertools;
33

4-
use super::define_generator;
54
use crate::{
65
codegen::LateCtx,
76
output::{output_path, Output},
@@ -12,6 +11,8 @@ use crate::{
1211
Generator,
1312
};
1413

14+
use super::define_generator;
15+
1516
const CUSTOM_TYPESCRIPT: &str = include_str!("../../../../crates/oxc_ast/src/ast/types.d.ts");
1617

1718
pub struct TypescriptGenerator;

tasks/ast_tools/src/generators/visit.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use quote::{format_ident, quote, ToTokens};
77
use rustc_hash::FxHashMap;
88
use syn::{parse_quote, Ident};
99

10-
use super::define_generator;
1110
use crate::{
1211
codegen::LateCtx,
1312
generators::ast_kind::BLACK_LIST as KIND_BLACK_LIST,
@@ -18,6 +17,8 @@ use crate::{
1817
Generator,
1918
};
2019

20+
use super::define_generator;
21+
2122
pub struct VisitGenerator;
2223

2324
define_generator!(VisitGenerator);

0 commit comments

Comments
 (0)