Clippy: the TypeScript generator passes the function directly (the previous commit failed the lint gate) 81a6254b92af
- Author
- Andy McCall @andymccall <[email protected]>
- When
- · 2026-09-27 19:28 UTC
- Signature
- ✔ signed by Andy McCall
- Hash
81a6254b92aff61a24aa95b736cdf908e49acca36d2a8c4f66cecee2cb146117- Depends on
- b64e2537d702
- Depended on by
- 9bc6b4720fc1
- In bookmarks
- api-unknown-fields cancel-landed-runs clear-waiting close-proposal-140 diffusion-pin-bookmark draft-ready image-check job-waits main oh-comment-body-file proposal-list-fast run-one-job wiki-says-so
- In tags
- v0.1.0 v0.2.0 v0.3.0 v0.3.1 v0.4.0 v0.4.1 v0.4.2 v0.5.0 v0.5.1 v0.5.2 v0.6.0 v0.6.1 v0.7.0 v0.8.0 v0.9.0 v0.9.1 v0.9.11 v0.9.15 v0.9.16 v0.9.19 v0.9.2 v0.9.20 v0.9.21 v0.9.22 v0.9.23 v0.9.24 v0.9.3 v0.9.4 v0.9.5 v0.9.6 v0.9.7 v0.9.8 v0.9.9
- Edits
- 3 atoms, 0 tree operations, 1 file
Browse the tree at this change
modified crates/hub-api/src/bin/typescript.rs +2 −2
| … | 15 unchanged lines |
||
| 16 | 16 | return serde_json::to_string(c).unwrap_or_default(); |
|
| 17 | 17 | } |
|
| 18 | 18 | if let Some(variants) = schema.get("oneOf").or_else(|| schema.get("anyOf")).and_then(Value::as_array) { |
|
| 19 | - | return variants.iter().map(|v| ts_type(v)).collect::<Vec<_>>().join(" | "); |
|
| 19 | + | return variants.iter().map(ts_type).collect::<Vec<_>>().join(" | "); |
|
| 20 | 20 | } |
|
| 21 | 21 | let nullable = schema.get("type").and_then(Value::as_array).is_some_and(|a| a.iter().any(|t| t == "null")); |
|
| 22 | 22 | let ty = match schema.get("type") { |
|
| … | 11 unchanged lines |
||
| 34 | 34 | "string" => "string".to_string(), |
|
| 35 | 35 | "integer" | "number" => "number".to_string(), |
|
| 36 | 36 | "boolean" => "boolean".to_string(), |
|
| 37 | - | "array" => format!("{}[]", schema.get("items").map(|i| ts_type(i)).unwrap_or_else(|| "unknown".into())), |
|
| 37 | + | "array" => format!("{}[]", schema.get("items").map(ts_type).unwrap_or_else(|| "unknown".into())), |
|
| 38 | 38 | "object" => { |
|
| 39 | 39 | let props = schema.get("properties").and_then(Value::as_object); |
|
| 40 | 40 | let required: Vec<&str> = |
|
| … | 38 unchanged lines |