Skip to content

Commit 3b502b0

Browse files
fabio-rovaiclaude
andcommitted
fix: resolve clippy warnings (consecutive replace, map_or, collapsible if)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 16ef90a commit 3b502b0

2 files changed

Lines changed: 7 additions & 9 deletions

File tree

src/align.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -567,10 +567,10 @@ fn local_name(iri: &str) -> String {
567567
/// Normalize a label for comparison: lowercase, split camelCase, trim.
568568
fn normalize_label(label: &str) -> String {
569569
// Replace underscores and hyphens with spaces, then camelCase split
570-
let cleaned = label.replace('_', " ").replace('-', " ");
570+
let cleaned = label.replace(['_', '-'], " ");
571571
let mut result = String::with_capacity(cleaned.len() + 8);
572572
for (i, ch) in cleaned.chars().enumerate() {
573-
if i > 0 && ch.is_uppercase() && !cleaned.as_bytes().get(i.wrapping_sub(1)).map_or(false, |c| c.is_ascii_uppercase()) {
573+
if i > 0 && ch.is_uppercase() && !cleaned.as_bytes().get(i.wrapping_sub(1)).is_some_and(|c| c.is_ascii_uppercase()) {
574574
result.push(' ');
575575
}
576576
result.push(ch);

src/socket.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -274,13 +274,11 @@ fn run_count_query(graph: &Arc<GraphStore>, query: &str) -> u64 {
274274
match graph.sparql_select(query) {
275275
Ok(json_str) => {
276276
// sparql_select returns {"variables":["c"],"results":[{"c":"\"3\"^^…"}]}
277-
if let Ok(v) = serde_json::from_str::<serde_json::Value>(&json_str) {
278-
if let Some(row) = v["results"].as_array().and_then(|a| a.first()) {
279-
if let Some(val) = row["c"].as_str() {
280-
// Oxigraph wraps the value like "\"3\"^^<…integer>"
281-
return parse_sparql_integer(val);
282-
}
283-
}
277+
if let Ok(v) = serde_json::from_str::<serde_json::Value>(&json_str)
278+
&& let Some(row) = v["results"].as_array().and_then(|a| a.first())
279+
&& let Some(val) = row["c"].as_str() {
280+
// Oxigraph wraps the value like "\"3\"^^<…integer>"
281+
return parse_sparql_integer(val);
284282
}
285283
0
286284
}

0 commit comments

Comments
 (0)