Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump extractions/setup-just from 2 to 3 #324

Merged

Merge branch 'main' into dependabot/github_actions/extractions/setup-…

9aef41f
Select commit
Loading
Failed to load commit list.
Sign in for the full log view
Merged

Bump extractions/setup-just from 2 to 3 #324

Merge branch 'main' into dependabot/github_actions/extractions/setup-…
9aef41f
Select commit
Loading
Failed to load commit list.
GitHub Actions / clippy succeeded Mar 18, 2025 in 0s

clippy

1 warning

Details

Results

Message level Amount
Internal compiler error 0
Error 0
Warning 1
Note 0
Help 0

Versions

  • rustc 1.87.0-nightly (227690a25 2025-03-16)
  • cargo 1.87.0-nightly (6cf826701 2025-03-14)
  • clippy 0.1.87 (227690a258 2025-03-16)

Annotations

Check warning on line 470 in src/analyzer.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unneeded `return` statement

warning: unneeded `return` statement
   --> src/analyzer.rs:433:17
    |
433 | /                 return match inner_array_type.as_ref() {
434 | |                     "object" => {
435 | |                         // Same logic as in `extract_container` to simplify types to maps.
436 | |                         let mut dict_value = None;
...   |
470 | |                 };
    | |_________________^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
    = note: `#[warn(clippy::needless_return)]` on by default
help: remove `return`
    |
433 ~                 match inner_array_type.as_ref() {
434 +                     "object" => {
435 +                         // Same logic as in `extract_container` to simplify types to maps.
436 +                         let mut dict_value = None;
437 +                         if let Some(additional) = &s.additional_properties {
438 +                             dict_value = resolve_additional_properties(additional, stack, key, s)?;
439 +                         }
440 + 
441 +                         let vec_value = if let Some(dict_value) = dict_value {
442 +                             let map_type = cfg.map.name();
443 +                             format!("{map_type}<String, {dict_value}>")
444 +                         } else {
445 +                             let structsuffix = key.to_upper_camel_case();
446 +                             format!("{stack}{structsuffix}")
447 +                         };
448 + 
449 +                         Ok((format!("Vec<{}>", vec_value), level))
450 +                     }
451 +                     "string" => Ok(("Vec<String>".into(), level)),
452 +                     "boolean" => Ok(("Vec<bool>".into(), level)),
453 +                     "date" => Ok((format!("Vec<{}>", extract_date_type(value)?), level)),
454 +                     "number" => Ok((format!("Vec<{}>", extract_number_type(value)?), level)),
455 +                     "integer" => Ok((format!("Vec<{}>", extract_integer_type(value)?), level)),
456 +                     "array" => {
457 +                         if s.items.is_some() {
458 +                             Ok(array_recurse_for_type(s, stack, key, level + 1, cfg)?)
459 +                         } else if cfg.relaxed {
460 +                             warn!("Empty inner array in: {} key: {}", stack, key);
461 +                             let map_type = cfg.map.name();
462 +                             Ok((format!("{}<String, serde_json::Value>", map_type), level))
463 +                         } else {
464 +                             bail!("Empty inner array in: {} key: {}", stack, key);
465 +                         }
466 +                     }
467 +                     unknown => {
468 +                         bail!("unsupported recursive array type \"{unknown}\" for {key}")
469 +                     }
470 ~                 }
    |