Repository navigation
Conversation
Replace write!(String).expect("fmt") in the canonical pattern printer
with String appends and a small hex helper; document in CHANGELOG.
mostafa
left a comment
There was a problem hiding this comment.
Comment only. The printer output matches the old write! formatting, and the seven expect("fmt") calls are gone. Integers, repeat counts, indices, and floats still go through Display. Booleans still print true and false. Hex is still two lowercase digits. cargo fmt --all -- --check, cargo clippy -p rstix --all-targets --all-features -- -D warnings, and cargo doc -p rstix --all-features --locked --no-deps are clean. cargo test -p rstix --features pattern --locked pattern::print passes (4 tests).
Non-blocking: those tests still pass if hex is printed in uppercase. See the comment on push_hex_byte.
CI, Docs, and Docs audit are action_required until a maintainer approves the fork workflows. This branch and #637 both insert a heading at the top of ## [Unreleased], so the second one to merge needs a rebase.
Assert the printed form of hex, a boolean, an index, an integer-valued float, and REPEATS. Semantic equality accepts any spelling that parses to the same value.
mostafa
left a comment
There was a problem hiding this comment.
Pushed 90a17e5b. canonical_spelling_pins_literals parses h'FFD8', true, sections[0], 7.0, and REPEATS 2 TIMES, and requires the printed string h'ffd8', true, [0], 7, and REPEATS 2 TIMES. Uppercase hex fails that test. fmt and clippy on rstix are clean.
|
Merged main in |
Summary
Removes seven production
write!(…).expect("fmt")calls from the STIX pattern canonical printer; output is unchanged.Test plan
cargo test -p rstix --features pattern --locked pattern::print