Skip to content

Commit 34b22fc

Browse files
authored
fix: clear clippy 1.96 drift + bump rustls-webpki (unblock CI) (#97)
* fix: unblock CI — clippy build.rs commas + rustls-webpki advisory 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. * 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).
1 parent 26b24ee commit 34b22fc

9 files changed

Lines changed: 29 additions & 32 deletions

File tree

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/rpg-core/src/graph.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ impl RPGraph {
526526
}
527527
}
528528
let mut result: Vec<(String, Vec<String>)> = by_file.into_iter().collect();
529-
result.sort_by(|a, b| b.1.len().cmp(&a.1.len()));
529+
result.sort_by_key(|x| std::cmp::Reverse(x.1.len()));
530530
result
531531
}
532532

crates/rpg-encoder/src/semantic_lifting.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ pub fn apply_features(
119119
pub fn aggregate_module_features(graph: &mut RPGraph) -> usize {
120120
let module_data: Vec<(String, Vec<String>)> = graph
121121
.file_index
122-
.iter()
123-
.filter_map(|(_, ids)| {
122+
.values()
123+
.filter_map(|ids| {
124124
let module_id = ids.iter().find(|id| {
125125
graph
126126
.entities

crates/rpg-lift/src/provider.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ impl AnthropicProvider {
6767
model: model.unwrap_or_else(|| Self::DEFAULT_MODEL.to_string()),
6868
agent: ureq::Agent::new_with_config(
6969
ureq::config::Config::builder()
70-
.timeout_global(Some(std::time::Duration::from_secs(120)))
70+
.timeout_global(Some(std::time::Duration::from_mins(2)))
7171
.build(),
7272
),
7373
}
@@ -193,7 +193,7 @@ impl OpenAiProvider {
193193
base_url: base_url.unwrap_or_else(|| Self::DEFAULT_BASE_URL.to_string()),
194194
agent: ureq::Agent::new_with_config(
195195
ureq::config::Config::builder()
196-
.timeout_global(Some(std::time::Duration::from_secs(120)))
196+
.timeout_global(Some(std::time::Duration::from_mins(2)))
197197
.build(),
198198
),
199199
}

crates/rpg-mcp/src/tools.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1867,10 +1867,10 @@ impl RpgServer {
18671867
} else {
18681868
cat_node.semantic_features.join(", ")
18691869
};
1870-
result.push_str(&format!(" - {}/{}: {}\n", area_name, cat_name, cat_feats,));
1870+
result.push_str(&format!(" - {}/{}: {}\n", area_name, cat_name, cat_feats));
18711871
for sub_name in cat_node.children.keys() {
18721872
result
1873-
.push_str(&format!(" - {}/{}/{}\n", area_name, cat_name, sub_name,));
1873+
.push_str(&format!(" - {}/{}/{}\n", area_name, cat_name, sub_name));
18741874
}
18751875
}
18761876
}
@@ -2914,7 +2914,7 @@ impl RpgServer {
29142914
);
29152915

29162916
if result.primary_entities.is_empty() {
2917-
return Ok(format!("{}No entities found for: {}", notice, params.query,));
2917+
return Ok(format!("{}No entities found for: {}", notice, params.query));
29182918
}
29192919

29202920
Ok(format!(

crates/rpg-nav/src/cycles.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ pub fn detect_cycles(graph: &RPGraph, config: &CycleConfig) -> CycleReport {
423423
stats
424424
})
425425
.collect();
426-
area_breakdown.sort_by(|a, b| b.cycle_count.cmp(&a.cycle_count));
426+
area_breakdown.sort_by_key(|x| std::cmp::Reverse(x.cycle_count));
427427

428428
let areas_in_cycles = area_breakdown.len();
429429

crates/rpg-nav/src/snapshot.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ fn build_hot_spots(graph: &RPGraph, top_n: usize) -> Vec<HotSpot> {
299299
(id.as_str(), connections)
300300
})
301301
.collect();
302-
scored.sort_by(|a, b| b.1.cmp(&a.1));
302+
scored.sort_by_key(|x| std::cmp::Reverse(x.1));
303303

304304
scored
305305
.into_iter()

crates/rpg-parser/build.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ fn generate_lang_registry(defs: &[LangToml]) -> String {
291291
\x20 .filter(|(_, count)| **count > 0)\n\
292292
\x20 .map(|(idx, count)| (Self::from_index(idx), *count))\n\
293293
\x20 .collect();\n\
294-
\x20 langs.sort_by(|a, b| b.1.cmp(&a.1));\n\
294+
\x20 langs.sort_by_key(|x| ::std::cmp::Reverse(x.1));\n\
295295
\x20 langs.into_iter().map(|(lang, _)| lang).collect()\n\
296296
\x20 }\n\n\
297297
\x20 /// Count files per language in the project.\n\
@@ -373,7 +373,7 @@ fn generate_lang_registry(defs: &[LangToml]) -> String {
373373
);
374374
for def in defs {
375375
if !def.grammar.aliases.is_empty() {
376-
code.push_str(&format!(" \"{}\" => match file_ext {{\n", def.name,));
376+
code.push_str(&format!(" \"{}\" => match file_ext {{\n", def.name));
377377
for alias in &def.grammar.aliases {
378378
let ext_patterns: Vec<String> = alias
379379
.for_extensions
@@ -429,7 +429,7 @@ fn generate_lang_registry(defs: &[LangToml]) -> String {
429429
if let Some(ref builtin) = def.builtin
430430
&& let Some(ref extractor) = builtin.dep_extractor
431431
{
432-
code.push_str(&format!(" {} => Some(\"{}\"),\n", i, extractor,));
432+
code.push_str(&format!(" {} => Some(\"{}\"),\n", i, extractor));
433433
}
434434
}
435435
code.push_str(" _ => None,\n }\n}\n\n");
@@ -444,7 +444,7 @@ fn generate_lang_registry(defs: &[LangToml]) -> String {
444444
if let Some(ref builtin) = def.builtin
445445
&& let Some(ref extractor) = builtin.entity_extractor
446446
{
447-
code.push_str(&format!(" {} => Some(\"{}\"),\n", i, extractor,));
447+
code.push_str(&format!(" {} => Some(\"{}\"),\n", i, extractor));
448448
}
449449
}
450450
code.push_str(" _ => None,\n }\n}\n");

crates/rpg-parser/src/deps.rs

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -360,22 +360,19 @@ fn collect_rust_calls(
360360
}
361361
}
362362
}
363-
"method_call_expression" | "field_expression" => {
364-
// obj.method() — tree-sitter-rust uses "method_call_expression" for x.foo()
365-
// but some versions nest it differently
366-
if child.kind() == "method_call_expression" {
367-
// The method name is in the "name" field
368-
if let Some(method_node) = child.child_by_field_name("name") {
369-
let callee = source[method_node.byte_range()].to_string();
370-
if !callee.is_empty() {
371-
let call_row = child.start_position().row;
372-
let caller = find_enclosing_scope(scopes, call_row)
373-
.unwrap_or_else(|| "<module>".to_string());
374-
calls.push(CallDep {
375-
caller_entity: caller,
376-
callee,
377-
});
378-
}
363+
"method_call_expression" => {
364+
// obj.method() — tree-sitter-rust uses "method_call_expression" for x.foo().
365+
// The method name is in the "name" field.
366+
if let Some(method_node) = child.child_by_field_name("name") {
367+
let callee = source[method_node.byte_range()].to_string();
368+
if !callee.is_empty() {
369+
let call_row = child.start_position().row;
370+
let caller = find_enclosing_scope(scopes, call_row)
371+
.unwrap_or_else(|| "<module>".to_string());
372+
calls.push(CallDep {
373+
caller_entity: caller,
374+
callee,
375+
});
379376
}
380377
}
381378
}

0 commit comments

Comments
 (0)