Skip to content

Commit f5bc8f9

Browse files
ci: format parser.rs under stable 1.96 to make rust-ci green (follow-up) (#44)
## Summary Follow-up to the merged CI-green PR (#43). With rust-ci now actually running, `cargo fmt --all -- --check` fails on `main` under the CI toolchain (stable rustfmt 1.96) — the toolchain-pin PR landed before the formatting fix did. This brings `src/codegen/parser.rs` to rustfmt-clean so rust-ci goes green. ## Changes - **Rust hygiene:** `cargo fmt` (`src/codegen/parser.rs`) so `cargo fmt --all -- --check` passes under stable 1.96. ## RSR Quality Checklist ### Required - [x] Tests pass (`cargo test --locked --all-targets`) - [x] Code is formatted (`cargo fmt --all -- --check`) - [x] Linter is clean (`cargo clippy --locked --all-targets -- -D warnings`) - [x] No banned language patterns - [x] SPDX license headers present on modified files - [x] No secrets, credentials, or `.env` files included ## Testing Verified locally with the CI toolchain (rustc/clippy/rustfmt 1.96.0): `cargo fmt --check`, `clippy -D warnings`, `cargo check --locked`, `cargo test --locked` all pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- _Generated by [Claude Code](https://claude.ai/code/session_01A6PSzJWpRxtzGDjUCEh7Mx)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 1d207e2 commit f5bc8f9

1 file changed

Lines changed: 36 additions & 9 deletions

File tree

src/codegen/parser.rs

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -258,19 +258,46 @@ mod tests {
258258
let spec = sample_spec();
259259
let func = parse_function(&spec).expect("TODO: handle error");
260260
assert!(func.decreases.is_some());
261-
assert_eq!(func.decreases.expect("TODO: handle error").expression, "arr.Length");
261+
assert_eq!(
262+
func.decreases.expect("TODO: handle error").expression,
263+
"arr.Length"
264+
);
262265
}
263266

264267
#[test]
265268
fn test_parse_target_all_valid() {
266-
assert_eq!(parse_target("csharp").expect("TODO: handle error"), TargetLanguage::CSharp);
267-
assert_eq!(parse_target("cs").expect("TODO: handle error"), TargetLanguage::CSharp);
268-
assert_eq!(parse_target("java").expect("TODO: handle error"), TargetLanguage::Java);
269-
assert_eq!(parse_target("go").expect("TODO: handle error"), TargetLanguage::Go);
270-
assert_eq!(parse_target("python").expect("TODO: handle error"), TargetLanguage::Python);
271-
assert_eq!(parse_target("py").expect("TODO: handle error"), TargetLanguage::Python);
272-
assert_eq!(parse_target("js").expect("TODO: handle error"), TargetLanguage::Js);
273-
assert_eq!(parse_target("javascript").expect("TODO: handle error"), TargetLanguage::Js);
269+
assert_eq!(
270+
parse_target("csharp").expect("TODO: handle error"),
271+
TargetLanguage::CSharp
272+
);
273+
assert_eq!(
274+
parse_target("cs").expect("TODO: handle error"),
275+
TargetLanguage::CSharp
276+
);
277+
assert_eq!(
278+
parse_target("java").expect("TODO: handle error"),
279+
TargetLanguage::Java
280+
);
281+
assert_eq!(
282+
parse_target("go").expect("TODO: handle error"),
283+
TargetLanguage::Go
284+
);
285+
assert_eq!(
286+
parse_target("python").expect("TODO: handle error"),
287+
TargetLanguage::Python
288+
);
289+
assert_eq!(
290+
parse_target("py").expect("TODO: handle error"),
291+
TargetLanguage::Python
292+
);
293+
assert_eq!(
294+
parse_target("js").expect("TODO: handle error"),
295+
TargetLanguage::Js
296+
);
297+
assert_eq!(
298+
parse_target("javascript").expect("TODO: handle error"),
299+
TargetLanguage::Js
300+
);
274301
}
275302

276303
#[test]

0 commit comments

Comments
 (0)