@@ -135,17 +135,13 @@ fn verify_status(version: Version, test_output: Option<&String>) -> Result<()> {
135
135
let out =
136
136
Method :: from_name ( version, & method. name ) . expect ( "guaranteed by methods_and_status()" ) ;
137
137
138
- if !versioned:: requires_type ( version, & method. name ) ? {
139
- if versioned:: type_exists ( version, & method. name ) ? {
140
- eprintln ! ( "return type found but method is omitted or TODO: {}" , output_method( out) ) ;
141
- }
142
- }
143
- if !model:: requires_type ( version, & method. name ) ? {
144
- if model:: type_exists ( version, & method. name ) ? {
145
- eprintln ! ( "model type found but method is omitted or TODO: {}" , output_method( out) ) ;
146
- }
138
+ if versioned:: type_exists ( version, & method. name ) ? && !versioned:: requires_type ( version, & method. name ) ? {
139
+ eprintln ! ( "return type found but method is omitted or TODO: {}" , output_method( out) ) ;
147
140
}
148
141
142
+ if model:: type_exists ( version, & method. name ) ? && !model:: requires_type ( version, & method. name ) ? {
143
+ eprintln ! ( "model type found but method is omitted or TODO: {}" , output_method( out) ) ;
144
+ }
149
145
}
150
146
}
151
147
}
@@ -156,19 +152,14 @@ fn verify_status(version: Version, test_output: Option<&String>) -> Result<()> {
156
152
fn check_types_exist_if_required ( version : Version , method_name : & str ) -> Result < ( ) > {
157
153
let out = Method :: from_name ( version, method_name) . expect ( "guaranteed by methods_and_status()" ) ;
158
154
159
- if versioned:: requires_type ( version, method_name) ? {
160
- if !versioned:: type_exists ( version, method_name) ? {
161
- eprintln ! ( "missing return type: {}" , output_method( out) ) ;
162
- }
155
+ if versioned:: requires_type ( version, method_name) ? && !versioned:: type_exists ( version, method_name) ? {
156
+ eprintln ! ( "missing return type: {}" , output_method( out) ) ;
163
157
}
164
- if model:: requires_type ( version, method_name) ? {
165
- if !model:: type_exists ( version, method_name) ? {
166
- eprintln ! ( "missing model type: {}" , output_method( out) ) ;
167
- }
168
- } else {
169
- if model:: type_exists ( version, method_name) ? {
170
- eprintln ! ( "found model type when none expected: {}" , output_method( out) ) ;
171
- }
158
+ if model:: requires_type ( version, method_name) ? && !model:: type_exists ( version, method_name) ? {
159
+ eprintln ! ( "missing model type: {}" , output_method( out) ) ;
160
+ }
161
+ if model:: type_exists ( version, method_name) ? && !model:: requires_type ( version, method_name) ? {
162
+ eprintln ! ( "found model type when none expected: {}" , output_method( out) ) ;
172
163
}
173
164
Ok ( ( ) )
174
165
}
0 commit comments