File tree Expand file tree Collapse file tree 2 files changed +1
-41
lines changed
crates/bevy_reflect/bevy_reflect_derive/src Expand file tree Collapse file tree 2 files changed +1
-41
lines changed Original file line number Diff line number Diff line change @@ -732,11 +732,6 @@ pub fn type_uuid_derive(input: proc_macro::TokenStream) -> proc_macro::TokenStre
732
732
type_uuid:: type_uuid_derive ( input)
733
733
}
734
734
735
- #[ proc_macro]
736
- pub fn external_type_uuid ( tokens : proc_macro:: TokenStream ) -> proc_macro:: TokenStream {
737
- type_uuid:: external_type_uuid ( tokens)
738
- }
739
-
740
735
#[ proc_macro_attribute]
741
736
pub fn reflect_trait ( args : TokenStream , input : TokenStream ) -> TokenStream {
742
737
reflect_trait:: reflect_trait ( & args, input)
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ extern crate proc_macro;
2
2
3
3
use bevy_macro_utils:: BevyManifest ;
4
4
use quote:: { quote, ToTokens } ;
5
- use syn:: { parse :: * , * } ;
5
+ use syn:: * ;
6
6
use uuid:: Uuid ;
7
7
8
8
pub fn type_uuid_derive ( input : proc_macro:: TokenStream ) -> proc_macro:: TokenStream {
@@ -65,38 +65,3 @@ pub fn type_uuid_derive(input: proc_macro::TokenStream) -> proc_macro::TokenStre
65
65
} ;
66
66
gen. into ( )
67
67
}
68
-
69
- struct ExternalDeriveInput {
70
- path : ExprPath ,
71
- uuid_str : LitStr ,
72
- }
73
-
74
- impl Parse for ExternalDeriveInput {
75
- fn parse ( input : ParseStream ) -> Result < Self > {
76
- let path = input. parse ( ) ?;
77
- input. parse :: < Token ! [ , ] > ( ) ?;
78
- let uuid_str = input. parse ( ) ?;
79
- Ok ( Self { path, uuid_str } )
80
- }
81
- }
82
-
83
- pub fn external_type_uuid ( tokens : proc_macro:: TokenStream ) -> proc_macro:: TokenStream {
84
- let ExternalDeriveInput { path, uuid_str } = parse_macro_input ! ( tokens as ExternalDeriveInput ) ;
85
-
86
- let uuid = Uuid :: parse_str ( & uuid_str. value ( ) ) . expect ( "Value was not a valid UUID." ) ;
87
-
88
- let bytes = uuid
89
- . as_bytes ( )
90
- . iter ( )
91
- . map ( |byte| format ! ( "{:#X}" , byte) )
92
- . map ( |byte_str| syn:: parse_str :: < LitInt > ( & byte_str) . unwrap ( ) ) ;
93
-
94
- let gen = quote ! {
95
- impl crate :: TypeUuid for #path {
96
- const TYPE_UUID : Uuid = uuid:: Uuid :: from_bytes( [
97
- #( #bytes ) , *
98
- ] ) ;
99
- }
100
- } ;
101
- gen. into ( )
102
- }
You can’t perform that action at this time.
0 commit comments