File tree Expand file tree Collapse file tree 9 files changed +9
-19
lines changed Expand file tree Collapse file tree 9 files changed +9
-19
lines changed Original file line number Diff line number Diff line change @@ -16,8 +16,7 @@ keywords = [
16
16
categories = [" development-tools" , " encoding" ]
17
17
18
18
[dependencies ]
19
- unsynn = " 0.1.0"
20
- quote = " 1.0.40"
19
+ unsynn = " 0.2"
21
20
22
21
[features ]
23
22
function = []
Original file line number Diff line number Diff line change @@ -41,7 +41,6 @@ pub fn parse_fn_shape_input(input: TokenStream) -> ParsedFnShapeInput {
41
41
#[ cfg( test) ]
42
42
mod tests {
43
43
use super :: * ;
44
- use quote:: quote;
45
44
46
45
#[ test]
47
46
fn test_simple_function_name ( ) {
Original file line number Diff line number Diff line change @@ -27,15 +27,14 @@ pub fn parse_function_body(tokens: &[TokenTree]) -> TokenStream {
27
27
Ok ( func_with_body) => func_with_body. body . to_token_stream ( ) ,
28
28
Err ( _) => {
29
29
// No function body found, return empty braces
30
- quote:: quote ! { { } }
30
+ quote ! { { } }
31
31
}
32
32
}
33
33
}
34
34
35
35
#[ cfg( test) ]
36
36
mod tests {
37
37
use super :: * ;
38
- use quote:: quote;
39
38
40
39
#[ test]
41
40
fn test_simple_function_body ( ) {
Original file line number Diff line number Diff line change @@ -35,7 +35,6 @@ pub fn parse_fn_parameters(params_ts: TokenStream) -> Vec<Parameter> {
35
35
#[ cfg( test) ]
36
36
mod tests {
37
37
use super :: * ;
38
- use quote:: quote;
39
38
40
39
#[ test]
41
40
fn test_empty_parameters ( ) {
Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ pub fn parse_function_signature(input: TokenStream) -> FunctionSignature {
99
99
let return_type = sig
100
100
. return_type
101
101
. map ( |rt| rt. return_type . to_token_stream ( ) )
102
- . unwrap_or_else ( || quote:: quote ! { ( ) } ) ;
102
+ . unwrap_or_else ( || quote ! { ( ) } ) ;
103
103
104
104
// Extract body
105
105
let body = sig. body . to_token_stream ( ) ;
@@ -125,7 +125,6 @@ pub fn parse_function_signature(input: TokenStream) -> FunctionSignature {
125
125
#[ cfg( test) ]
126
126
mod tests {
127
127
use super :: * ;
128
- use quote:: quote;
129
128
130
129
#[ test]
131
130
fn test_simple_function ( ) {
Original file line number Diff line number Diff line change @@ -39,7 +39,6 @@ pub fn parse_generics_for_test(input: TokenStream) -> Option<GenericParams> {
39
39
#[ cfg( test) ]
40
40
mod tests {
41
41
use super :: * ;
42
- use quote:: quote;
43
42
44
43
#[ test]
45
44
fn test_no_generics ( ) {
Original file line number Diff line number Diff line change @@ -26,15 +26,14 @@ pub fn parse_return_type(tokens: Vec<TokenTree>) -> TokenStream {
26
26
Ok ( ret_type) => ret_type. return_type . to_token_stream ( ) ,
27
27
Err ( _) => {
28
28
// No return type found, default to unit type
29
- quote:: quote ! { ( ) }
29
+ quote ! { ( ) }
30
30
}
31
31
}
32
32
}
33
33
34
34
#[ cfg( test) ]
35
35
mod tests {
36
36
use super :: * ;
37
- use quote:: quote;
38
37
39
38
#[ test]
40
39
fn test_no_return_type ( ) {
Original file line number Diff line number Diff line change @@ -10,33 +10,31 @@ pub fn extract_type_params(generics_ts: TokenStream) -> TokenStream {
10
10
11
11
match it. parse :: < GenericParams > ( ) {
12
12
Ok ( generics) => {
13
- let type_param_names: Vec < _ > = generics
13
+ let type_param_names: CommaDelimitedVec < _ > = generics
14
14
. params
15
15
. 0
16
16
. into_iter ( )
17
17
. map ( |delim| delim. value . name )
18
18
. collect ( ) ;
19
19
20
20
if type_param_names. is_empty ( ) {
21
- quote:: quote ! { ( ) }
21
+ quote ! { ( ) }
22
22
} else if type_param_names. len ( ) == 1 {
23
- let param = & type_param_names[ 0 ] ;
24
- quote:: quote! { #param }
23
+ quote ! { #type_param_names }
25
24
} else {
26
- quote:: quote ! { ( #( # type_param_names ) , * ) }
25
+ quote ! { ( #type_param_names ) }
27
26
}
28
27
}
29
28
Err ( _) => {
30
29
// Fallback to unit type if parsing fails
31
- quote:: quote ! { ( ) }
30
+ quote ! { ( ) }
32
31
}
33
32
}
34
33
}
35
34
36
35
#[ cfg( test) ]
37
36
mod tests {
38
37
use super :: * ;
39
- use quote:: quote;
40
38
41
39
#[ test]
42
40
fn test_single_type_param ( ) {
Original file line number Diff line number Diff line change @@ -600,7 +600,6 @@ impl Struct {
600
600
#[ cfg( test) ]
601
601
mod tests {
602
602
use super :: * ;
603
- use quote:: quote;
604
603
605
604
#[ test]
606
605
fn test_struct_with_field_doc_comments ( ) {
You can’t perform that action at this time.
0 commit comments