Skip to content

Commit 5908e54

Browse files
committed
claude: style(specl): apply cargo fmt
1 parent c8326fb commit 5908e54

3 files changed

Lines changed: 25 additions & 31 deletions

File tree

specl/crates/specl-cli/src/main.rs

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3560,28 +3560,20 @@ fn parse_constants(constants: &[String], spec: &specl_ir::CompiledSpec) -> CliRe
35603560
let value_str = parts[1].trim();
35613561

35623562
// Find the constant
3563-
let const_decl =
3564-
spec.consts
3565-
.iter()
3566-
.find(|c| c.name == name)
3567-
.ok_or_else(|| {
3568-
let available: Vec<&str> =
3569-
spec.consts.iter().map(|c| c.name.as_str()).collect();
3570-
CliError::Other {
3571-
message: if available.is_empty() {
3572-
format!(
3573-
"unknown constant '{}': this spec has no constants",
3574-
name
3575-
)
3576-
} else {
3577-
format!(
3578-
"unknown constant '{}' (available: {})",
3579-
name,
3580-
available.join(", ")
3581-
)
3582-
},
3583-
}
3584-
})?;
3563+
let const_decl = spec.consts.iter().find(|c| c.name == name).ok_or_else(|| {
3564+
let available: Vec<&str> = spec.consts.iter().map(|c| c.name.as_str()).collect();
3565+
CliError::Other {
3566+
message: if available.is_empty() {
3567+
format!("unknown constant '{}': this spec has no constants", name)
3568+
} else {
3569+
format!(
3570+
"unknown constant '{}' (available: {})",
3571+
name,
3572+
available.join(", ")
3573+
)
3574+
},
3575+
}
3576+
})?;
35853577

35863578
// Parse the value
35873579
let value = parse_value(value_str)?;
@@ -3679,14 +3671,20 @@ fn split_top_level_csv(s: &str) -> CliResult<Vec<&str>> {
36793671

36803672
if brace_depth < 0 || bracket_depth < 0 || paren_depth < 0 {
36813673
return Err(CliError::Other {
3682-
message: format!("unbalanced brackets in value '{}': extra closing delimiter", s),
3674+
message: format!(
3675+
"unbalanced brackets in value '{}': extra closing delimiter",
3676+
s
3677+
),
36833678
});
36843679
}
36853680
}
36863681

36873682
if in_string || brace_depth != 0 || bracket_depth != 0 || paren_depth != 0 {
36883683
return Err(CliError::Other {
3689-
message: format!("unbalanced delimiters in value '{}': unclosed bracket, brace, paren, or string", s),
3684+
message: format!(
3685+
"unbalanced delimiters in value '{}': unclosed bracket, brace, paren, or string",
3686+
s
3687+
),
36903688
});
36913689
}
36923690

specl/crates/specl-eval/src/value.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,14 +323,12 @@ impl Value {
323323
}
324324

325325
pub fn empty_set() -> Self {
326-
static EMPTY_SET: LazyLock<Value> =
327-
LazyLock::new(|| Value::set(Arc::new(Vec::new())));
326+
static EMPTY_SET: LazyLock<Value> = LazyLock::new(|| Value::set(Arc::new(Vec::new())));
328327
EMPTY_SET.clone()
329328
}
330329

331330
pub fn empty_seq() -> Self {
332-
static EMPTY_SEQ: LazyLock<Value> =
333-
LazyLock::new(|| Value::seq(Vec::new()));
331+
static EMPTY_SEQ: LazyLock<Value> = LazyLock::new(|| Value::seq(Vec::new()));
334332
EMPTY_SEQ.clone()
335333
}
336334

specl/crates/specl-syntax/src/parser.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1412,9 +1412,7 @@ impl Parser {
14121412
}
14131413
depth -= 1;
14141414
}
1415-
TokenKind::Let | TokenKind::All | TokenKind::Any | TokenKind::Fix
1416-
if depth == 0 =>
1417-
{
1415+
TokenKind::Let | TokenKind::All | TokenKind::Any | TokenKind::Fix if depth == 0 => {
14181416
pending_keyword_ins += 1;
14191417
}
14201418
TokenKind::In if depth == 0 => {

0 commit comments

Comments
 (0)