|
| 1 | +#![feature(let_chains)] |
| 2 | + |
1 | 3 | mod enums;
|
2 | 4 | mod parse;
|
3 | 5 | mod shared;
|
@@ -266,27 +268,27 @@ fn validate(input: &mut StructuredInput) -> syn::Result<Vec<&'static MathOpInfo>
|
266 | 268 | }
|
267 | 269 | }
|
268 | 270 |
|
269 |
| - if let Some(map) = &input.fn_extra { |
270 |
| - if !map.keys().any(|key| key == "_") { |
271 |
| - // No default provided; make sure every expected function is covered |
272 |
| - let mut fns_not_covered = Vec::new(); |
273 |
| - for func in &fn_list { |
274 |
| - if !map.keys().any(|key| key == func.name) { |
275 |
| - // `name` was not mentioned in the `match` statement |
276 |
| - fns_not_covered.push(func); |
277 |
| - } |
| 271 | + if let Some(map) = &input.fn_extra |
| 272 | + && !map.keys().any(|key| key == "_") |
| 273 | + { |
| 274 | + // No default provided; make sure every expected function is covered |
| 275 | + let mut fns_not_covered = Vec::new(); |
| 276 | + for func in &fn_list { |
| 277 | + if !map.keys().any(|key| key == func.name) { |
| 278 | + // `name` was not mentioned in the `match` statement |
| 279 | + fns_not_covered.push(func); |
278 | 280 | }
|
| 281 | + } |
279 | 282 |
|
280 |
| - if !fns_not_covered.is_empty() { |
281 |
| - let e = syn::Error::new( |
282 |
| - input.fn_extra_span.unwrap(), |
283 |
| - format!( |
284 |
| - "`fn_extra`: no default `_` pattern specified and the following \ |
285 |
| - patterns are not covered: {fns_not_covered:#?}" |
286 |
| - ), |
287 |
| - ); |
288 |
| - return Err(e); |
289 |
| - } |
| 283 | + if !fns_not_covered.is_empty() { |
| 284 | + let e = syn::Error::new( |
| 285 | + input.fn_extra_span.unwrap(), |
| 286 | + format!( |
| 287 | + "`fn_extra`: no default `_` pattern specified and the following \ |
| 288 | + patterns are not covered: {fns_not_covered:#?}" |
| 289 | + ), |
| 290 | + ); |
| 291 | + return Err(e); |
290 | 292 | }
|
291 | 293 | };
|
292 | 294 |
|
|
0 commit comments