Skip to content

Commit 01d0f23

Browse files
corvid-agentclaude
andauthored
fix: apply rustfmt to all if-let chain blocks (#1)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 7950590 commit 01d0f23

4 files changed

Lines changed: 37 additions & 32 deletions

File tree

src/exports/kotlin.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,14 @@ pub fn extract_exports(content: &str) -> Vec<String> {
3535
}
3636

3737
if let Some(caps) = KT_DECL.captures(line)
38-
&& let Some(name) = caps.get(1) {
39-
// Skip companion objects (they're not standalone exports)
40-
if trimmed.starts_with("companion") {
41-
continue;
42-
}
43-
symbols.push(name.as_str().to_string());
38+
&& let Some(name) = caps.get(1)
39+
{
40+
// Skip companion objects (they're not standalone exports)
41+
if trimmed.starts_with("companion") {
42+
continue;
4443
}
44+
symbols.push(name.as_str().to_string());
45+
}
4546
}
4647

4748
symbols

src/exports/python.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,16 @@ static QUOTED: LazyLock<Regex> = LazyLock::new(|| Regex::new(r#"["'](\w+)["']"#)
1818
pub fn extract_exports(content: &str) -> Vec<String> {
1919
// Check for __all__ first
2020
if let Some(caps) = ALL_DECL.captures(content)
21-
&& let Some(list) = caps.get(1) {
22-
let mut symbols = Vec::new();
23-
for name_cap in QUOTED.captures_iter(list.as_str()) {
24-
if let Some(name) = name_cap.get(1) {
25-
symbols.push(name.as_str().to_string());
26-
}
21+
&& let Some(list) = caps.get(1)
22+
{
23+
let mut symbols = Vec::new();
24+
for name_cap in QUOTED.captures_iter(list.as_str()) {
25+
if let Some(name) = name_cap.get(1) {
26+
symbols.push(name.as_str().to_string());
2727
}
28-
return symbols;
2928
}
29+
return symbols;
30+
}
3031

3132
// Fallback: top-level def/class that don't start with _
3233
let mut symbols = Vec::new();

src/main.rs

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -418,16 +418,17 @@ fn exit_with_status(
418418
}
419419

420420
if let Some(req) = require_coverage
421-
&& coverage.coverage_percent < req {
422-
println!(
423-
"\n{} {req}%: actual coverage is {}% ({} file(s) missing specs)",
424-
"--require-coverage".red(),
425-
coverage.coverage_percent,
426-
coverage.unspecced_files.len()
427-
);
428-
for f in &coverage.unspecced_files {
429-
println!(" {} {f}", "✗".red());
430-
}
431-
process::exit(1);
421+
&& coverage.coverage_percent < req
422+
{
423+
println!(
424+
"\n{} {req}%: actual coverage is {}% ({} file(s) missing specs)",
425+
"--require-coverage".red(),
426+
coverage.coverage_percent,
427+
coverage.unspecced_files.len()
428+
);
429+
for f in &coverage.unspecced_files {
430+
println!(" {} {f}", "✗".red());
432431
}
432+
process::exit(1);
433+
}
433434
}

src/parser.rs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ pub fn parse_frontmatter(content: &str) -> Option<ParsedSpec> {
2626
for line in yaml_block.lines() {
2727
// List item: " - value"
2828
if let Some(stripped) = line.trim_start().strip_prefix("- ")
29-
&& current_key.is_some() {
30-
current_list.push(stripped.trim().to_string());
31-
continue;
32-
}
29+
&& current_key.is_some()
30+
{
31+
current_list.push(stripped.trim().to_string());
32+
continue;
33+
}
3334

3435
// Key-value: "key: value" or "key:"
3536
if let Some(colon_pos) = line.find(':') {
@@ -58,10 +59,11 @@ pub fn parse_frontmatter(content: &str) -> Option<ParsedSpec> {
5859
// Blank or comment line: flush
5960
let trimmed = line.trim();
6061
if (trimmed.is_empty() || trimmed.starts_with('#'))
61-
&& let Some(prev_key) = current_key.take() {
62-
set_field(&mut fm, &prev_key, &current_list);
63-
current_list.clear();
64-
}
62+
&& let Some(prev_key) = current_key.take()
63+
{
64+
set_field(&mut fm, &prev_key, &current_list);
65+
current_list.clear();
66+
}
6567
}
6668

6769
// Flush trailing list

0 commit comments

Comments
 (0)