From 2283eaf9be1bdbea5e18cfcc8a2cc7610f227d36 Mon Sep 17 00:00:00 2001 From: theta-gamma Date: Fri, 29 May 2026 19:30:29 +0200 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20unblock=20CI=20=E2=80=94=20clippy=20?= =?UTF-8?q?build.rs=20commas=20+=20rustls-webpki=20advisory?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two pre-existing failures on main (toolchain + advisory-db drift) that block every PR: - crates/rpg-parser/build.rs: remove 3 unnecessary trailing commas in format! args (newer stable clippy flags them under -D warnings). - Cargo.lock: bump rustls-webpki 0.103.11 -> 0.103.13, resolving RUSTSEC-2026-0104 (reachable panic in CRL parsing) and RUSTSEC-2026-0099. --- Cargo.lock | 4 ++-- crates/rpg-parser/build.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3e069de..726dca8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2860,9 +2860,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.103.11" +version = "0.103.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20a6af516fea4b20eccceaf166e8aa666ac996208e8a644ce3ef5aa783bc7cd4" +checksum = "61c429a8649f110dddef65e2a5ad240f747e85f7758a6bccc7e5777bd33f756e" dependencies = [ "ring", "rustls-pki-types", diff --git a/crates/rpg-parser/build.rs b/crates/rpg-parser/build.rs index 93385da..abc2fdf 100644 --- a/crates/rpg-parser/build.rs +++ b/crates/rpg-parser/build.rs @@ -373,7 +373,7 @@ fn generate_lang_registry(defs: &[LangToml]) -> String { ); for def in defs { if !def.grammar.aliases.is_empty() { - code.push_str(&format!(" \"{}\" => match file_ext {{\n", def.name,)); + code.push_str(&format!(" \"{}\" => match file_ext {{\n", def.name)); for alias in &def.grammar.aliases { let ext_patterns: Vec = alias .for_extensions @@ -429,7 +429,7 @@ fn generate_lang_registry(defs: &[LangToml]) -> String { if let Some(ref builtin) = def.builtin && let Some(ref extractor) = builtin.dep_extractor { - code.push_str(&format!(" {} => Some(\"{}\"),\n", i, extractor,)); + code.push_str(&format!(" {} => Some(\"{}\"),\n", i, extractor)); } } code.push_str(" _ => None,\n }\n}\n\n"); @@ -444,7 +444,7 @@ fn generate_lang_registry(defs: &[LangToml]) -> String { if let Some(ref builtin) = def.builtin && let Some(ref extractor) = builtin.entity_extractor { - code.push_str(&format!(" {} => Some(\"{}\"),\n", i, extractor,)); + code.push_str(&format!(" {} => Some(\"{}\"),\n", i, extractor)); } } code.push_str(" _ => None,\n }\n}\n"); From 240c0057485f75d725a51dfd3f634cfd9ee27812 Mon Sep 17 00:00:00 2001 From: theta-gamma Date: Fri, 29 May 2026 19:44:00 +0200 Subject: [PATCH 2/2] fix: clear all clippy 1.96 drift + bump rustls-webpki to 0.103.13 CI uses dtolnay/rust-toolchain@stable (now 1.96), which flags lints absent in older clippy. Resolve every workspace lint under -D warnings: - sort_by -> sort_by_key(Reverse(..)): graph.rs, cycles.rs, snapshot.rs, and the build.rs codegen for lang_registry. - unnecessary trailing commas in format! args: build.rs, tools.rs. - iterating a map's values: semantic_lifting.rs (file_index.values()). - collapsible match arm: deps.rs (method_call_expression only). - duration_suboptimal_units: provider.rs from_secs(120) -> from_mins(2). Also bump rustls-webpki 0.103.11 -> 0.103.13 (RUSTSEC-2026-0099/0104). --- crates/rpg-core/src/graph.rs | 2 +- crates/rpg-encoder/src/semantic_lifting.rs | 4 +-- crates/rpg-lift/src/provider.rs | 4 +-- crates/rpg-mcp/src/tools.rs | 6 ++--- crates/rpg-nav/src/cycles.rs | 2 +- crates/rpg-nav/src/snapshot.rs | 2 +- crates/rpg-parser/build.rs | 2 +- crates/rpg-parser/src/deps.rs | 29 ++++++++++------------ 8 files changed, 24 insertions(+), 27 deletions(-) diff --git a/crates/rpg-core/src/graph.rs b/crates/rpg-core/src/graph.rs index 0d40758..7b5b2bf 100644 --- a/crates/rpg-core/src/graph.rs +++ b/crates/rpg-core/src/graph.rs @@ -526,7 +526,7 @@ impl RPGraph { } } let mut result: Vec<(String, Vec)> = by_file.into_iter().collect(); - result.sort_by(|a, b| b.1.len().cmp(&a.1.len())); + result.sort_by_key(|x| std::cmp::Reverse(x.1.len())); result } diff --git a/crates/rpg-encoder/src/semantic_lifting.rs b/crates/rpg-encoder/src/semantic_lifting.rs index 317e4a8..228f850 100644 --- a/crates/rpg-encoder/src/semantic_lifting.rs +++ b/crates/rpg-encoder/src/semantic_lifting.rs @@ -119,8 +119,8 @@ pub fn apply_features( pub fn aggregate_module_features(graph: &mut RPGraph) -> usize { let module_data: Vec<(String, Vec)> = graph .file_index - .iter() - .filter_map(|(_, ids)| { + .values() + .filter_map(|ids| { let module_id = ids.iter().find(|id| { graph .entities diff --git a/crates/rpg-lift/src/provider.rs b/crates/rpg-lift/src/provider.rs index 59ded06..0137c65 100644 --- a/crates/rpg-lift/src/provider.rs +++ b/crates/rpg-lift/src/provider.rs @@ -67,7 +67,7 @@ impl AnthropicProvider { model: model.unwrap_or_else(|| Self::DEFAULT_MODEL.to_string()), agent: ureq::Agent::new_with_config( ureq::config::Config::builder() - .timeout_global(Some(std::time::Duration::from_secs(120))) + .timeout_global(Some(std::time::Duration::from_mins(2))) .build(), ), } @@ -193,7 +193,7 @@ impl OpenAiProvider { base_url: base_url.unwrap_or_else(|| Self::DEFAULT_BASE_URL.to_string()), agent: ureq::Agent::new_with_config( ureq::config::Config::builder() - .timeout_global(Some(std::time::Duration::from_secs(120))) + .timeout_global(Some(std::time::Duration::from_mins(2))) .build(), ), } diff --git a/crates/rpg-mcp/src/tools.rs b/crates/rpg-mcp/src/tools.rs index 74d8190..4a17e93 100644 --- a/crates/rpg-mcp/src/tools.rs +++ b/crates/rpg-mcp/src/tools.rs @@ -1867,10 +1867,10 @@ impl RpgServer { } else { cat_node.semantic_features.join(", ") }; - result.push_str(&format!(" - {}/{}: {}\n", area_name, cat_name, cat_feats,)); + result.push_str(&format!(" - {}/{}: {}\n", area_name, cat_name, cat_feats)); for sub_name in cat_node.children.keys() { result - .push_str(&format!(" - {}/{}/{}\n", area_name, cat_name, sub_name,)); + .push_str(&format!(" - {}/{}/{}\n", area_name, cat_name, sub_name)); } } } @@ -2914,7 +2914,7 @@ impl RpgServer { ); if result.primary_entities.is_empty() { - return Ok(format!("{}No entities found for: {}", notice, params.query,)); + return Ok(format!("{}No entities found for: {}", notice, params.query)); } Ok(format!( diff --git a/crates/rpg-nav/src/cycles.rs b/crates/rpg-nav/src/cycles.rs index 1e1cd0b..2babc20 100644 --- a/crates/rpg-nav/src/cycles.rs +++ b/crates/rpg-nav/src/cycles.rs @@ -423,7 +423,7 @@ pub fn detect_cycles(graph: &RPGraph, config: &CycleConfig) -> CycleReport { stats }) .collect(); - area_breakdown.sort_by(|a, b| b.cycle_count.cmp(&a.cycle_count)); + area_breakdown.sort_by_key(|x| std::cmp::Reverse(x.cycle_count)); let areas_in_cycles = area_breakdown.len(); diff --git a/crates/rpg-nav/src/snapshot.rs b/crates/rpg-nav/src/snapshot.rs index d345af2..7948460 100644 --- a/crates/rpg-nav/src/snapshot.rs +++ b/crates/rpg-nav/src/snapshot.rs @@ -299,7 +299,7 @@ fn build_hot_spots(graph: &RPGraph, top_n: usize) -> Vec { (id.as_str(), connections) }) .collect(); - scored.sort_by(|a, b| b.1.cmp(&a.1)); + scored.sort_by_key(|x| std::cmp::Reverse(x.1)); scored .into_iter() diff --git a/crates/rpg-parser/build.rs b/crates/rpg-parser/build.rs index abc2fdf..9eddf98 100644 --- a/crates/rpg-parser/build.rs +++ b/crates/rpg-parser/build.rs @@ -291,7 +291,7 @@ fn generate_lang_registry(defs: &[LangToml]) -> String { \x20 .filter(|(_, count)| **count > 0)\n\ \x20 .map(|(idx, count)| (Self::from_index(idx), *count))\n\ \x20 .collect();\n\ - \x20 langs.sort_by(|a, b| b.1.cmp(&a.1));\n\ + \x20 langs.sort_by_key(|x| ::std::cmp::Reverse(x.1));\n\ \x20 langs.into_iter().map(|(lang, _)| lang).collect()\n\ \x20 }\n\n\ \x20 /// Count files per language in the project.\n\ diff --git a/crates/rpg-parser/src/deps.rs b/crates/rpg-parser/src/deps.rs index e277d8b..766e539 100644 --- a/crates/rpg-parser/src/deps.rs +++ b/crates/rpg-parser/src/deps.rs @@ -360,22 +360,19 @@ fn collect_rust_calls( } } } - "method_call_expression" | "field_expression" => { - // obj.method() — tree-sitter-rust uses "method_call_expression" for x.foo() - // but some versions nest it differently - if child.kind() == "method_call_expression" { - // The method name is in the "name" field - if let Some(method_node) = child.child_by_field_name("name") { - let callee = source[method_node.byte_range()].to_string(); - if !callee.is_empty() { - let call_row = child.start_position().row; - let caller = find_enclosing_scope(scopes, call_row) - .unwrap_or_else(|| "".to_string()); - calls.push(CallDep { - caller_entity: caller, - callee, - }); - } + "method_call_expression" => { + // obj.method() — tree-sitter-rust uses "method_call_expression" for x.foo(). + // The method name is in the "name" field. + if let Some(method_node) = child.child_by_field_name("name") { + let callee = source[method_node.byte_range()].to_string(); + if !callee.is_empty() { + let call_row = child.start_position().row; + let caller = find_enclosing_scope(scopes, call_row) + .unwrap_or_else(|| "".to_string()); + calls.push(CallDep { + caller_entity: caller, + callee, + }); } } }