Skip to content

error: correct field name in zic AT parse error - #641

Open
yhuikzdtguioaert wants to merge 1 commit into
BurntSushi:masterfrom
yhuikzdtguioaert:zic-at-field-error
Open

error: correct field name in zic AT parse error#641
yhuikzdtguioaert wants to merge 1 commit into
BurntSushi:masterfrom
yhuikzdtguioaert:zic-at-field-error

Conversation

@yhuikzdtguioaert

Copy link
Copy Markdown

Error::FailedParseFieldAt is the error returned when a Rule line's AT field fails to parse (see RuleP::parse in crates/jiff/src/tz/zic.rs). Its Display arm wrote failed to parse NAME field, which looks to have been copied from the neighbouring FailedParseFieldName arm and never updated — every other FailedParseField* variant names its own field. It now reports the AT field.

I also added a regression test that parses a rule with an invalid AT field and asserts the message points at AT.

Fixes #639.

The `Display` implementation for `Error::FailedParseFieldAt` wrote
"failed to parse `NAME` field", which looks to have been copied from the
`FailedParseFieldName` arm. This error is only produced when a rule's
`AT` field fails to parse, so report the `AT` field instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Copy paste bug in crates/jiff/src/error/tz/zic.rs

1 participant