@@ -81,35 +81,6 @@ pub enum XtaskCmd {
81
81
Codegen ( Codegen ) ,
82
82
}
83
83
84
- #[ derive( Debug ) ]
85
- pub struct Codegen {
86
- pub check : bool ,
87
- pub codegen_type : Option < CodegenType > ,
88
- }
89
-
90
- #[ derive( Debug , Default ) ]
91
- pub enum CodegenType {
92
- #[ default]
93
- All ,
94
- Grammar ,
95
- AssistsDocTests ,
96
- DiagnosticsDocs ,
97
- LintDefinitions ,
98
- }
99
-
100
- impl FromStr for CodegenType {
101
- type Err = String ;
102
- fn from_str ( s : & str ) -> Result < Self , Self :: Err > {
103
- match s {
104
- "all" => Ok ( Self :: All ) ,
105
- "grammar" => Ok ( Self :: Grammar ) ,
106
- "assists-doc-tests" => Ok ( Self :: AssistsDocTests ) ,
107
- "diagnostics-docs" => Ok ( Self :: DiagnosticsDocs ) ,
108
- "lints-definitions" => Ok ( Self :: LintDefinitions ) ,
109
- _ => Err ( "Invalid option" . to_owned ( ) ) ,
110
- }
111
- }
112
- }
113
84
#[ derive( Debug ) ]
114
85
pub struct Install {
115
86
pub client : bool ,
@@ -145,6 +116,65 @@ pub struct PublishReleaseNotes {
145
116
pub dry_run : bool ,
146
117
}
147
118
119
+ #[ derive( Debug ) ]
120
+ pub struct Metrics {
121
+ pub measurement_type : Option < MeasurementType > ,
122
+ }
123
+
124
+ #[ derive( Debug ) ]
125
+ pub struct Bb {
126
+ pub suffix : String ,
127
+ }
128
+
129
+ #[ derive( Debug ) ]
130
+ pub struct Codegen {
131
+ pub codegen_type : Option < CodegenType > ,
132
+
133
+ pub check : bool ,
134
+ }
135
+
136
+ impl Xtask {
137
+ #[ allow( dead_code) ]
138
+ pub fn from_env_or_exit ( ) -> Self {
139
+ Self :: from_env_or_exit_ ( )
140
+ }
141
+
142
+ #[ allow( dead_code) ]
143
+ pub fn from_env ( ) -> xflags:: Result < Self > {
144
+ Self :: from_env_ ( )
145
+ }
146
+
147
+ #[ allow( dead_code) ]
148
+ pub fn from_vec ( args : Vec < std:: ffi:: OsString > ) -> xflags:: Result < Self > {
149
+ Self :: from_vec_ ( args)
150
+ }
151
+ }
152
+ // generated end
153
+
154
+ #[ derive( Debug , Default ) ]
155
+ pub enum CodegenType {
156
+ #[ default]
157
+ All ,
158
+ Grammar ,
159
+ AssistsDocTests ,
160
+ DiagnosticsDocs ,
161
+ LintDefinitions ,
162
+ }
163
+
164
+ impl FromStr for CodegenType {
165
+ type Err = String ;
166
+ fn from_str ( s : & str ) -> Result < Self , Self :: Err > {
167
+ match s {
168
+ "all" => Ok ( Self :: All ) ,
169
+ "grammar" => Ok ( Self :: Grammar ) ,
170
+ "assists-doc-tests" => Ok ( Self :: AssistsDocTests ) ,
171
+ "diagnostics-docs" => Ok ( Self :: DiagnosticsDocs ) ,
172
+ "lints-definitions" => Ok ( Self :: LintDefinitions ) ,
173
+ _ => Err ( "Invalid option" . to_owned ( ) ) ,
174
+ }
175
+ }
176
+ }
177
+
148
178
#[ derive( Debug ) ]
149
179
pub enum MeasurementType {
150
180
Build ,
@@ -185,34 +215,6 @@ impl AsRef<str> for MeasurementType {
185
215
}
186
216
}
187
217
188
- #[ derive( Debug ) ]
189
- pub struct Metrics {
190
- pub measurement_type : Option < MeasurementType > ,
191
- }
192
-
193
- #[ derive( Debug ) ]
194
- pub struct Bb {
195
- pub suffix : String ,
196
- }
197
-
198
- impl Xtask {
199
- #[ allow( dead_code) ]
200
- pub fn from_env_or_exit ( ) -> Self {
201
- Self :: from_env_or_exit_ ( )
202
- }
203
-
204
- #[ allow( dead_code) ]
205
- pub fn from_env ( ) -> xflags:: Result < Self > {
206
- Self :: from_env_ ( )
207
- }
208
-
209
- #[ allow( dead_code) ]
210
- pub fn from_vec ( args : Vec < std:: ffi:: OsString > ) -> xflags:: Result < Self > {
211
- Self :: from_vec_ ( args)
212
- }
213
- }
214
- // generated end
215
-
216
218
impl Install {
217
219
pub ( crate ) fn server ( & self ) -> Option < ServerOpt > {
218
220
if self . client && !self . server {
0 commit comments