A malformed pair does not say which side was malformed #28
Labels
No labels
kind
bug
kind
enhancement
kind
refactor
workflow
needs-info
workflow
needs-triage
workflow
ready-for-agent
workflow
ready-for-human
workflow
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
rosa/lucre#28
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
read_currency(src/exchange/rate.rs:514) resolves one side of a pair'snotation and knows which side it is holding. Neither error it can return keeps
that:
ParsePairError::Codepasses the innerIsoAlphabeticCodeErroralonguntouched, and
ParsePairError::UnknownCurrencycarries the code alone(
src/exchange/rate.rs:544-550).So
"usd/EUR"and"USD/eur"are turned away in terms that differ only in thetext quoted back, and
"ZZZ/EUR"reads exactly as"USD/ZZZ"would with thecodes swapped. A caller wanting to point at the offending half — underlining it
in a form field, say — has to match the quoted code against their own input to
work out which one it was.
Since #19 the content is all there; what is missing is the label. Both variants
are
#[non_exhaustive], so a field can be added to either without breaking.What it costs is the type to name the side with — a public
Side { Base, Quote }enum, small but permanent, or a
boolthat nobody should have to read. Thecheaper reading is to name the side only in the
Displaymessage and leave thevariants as they are, which helps a person and not a program.
Which of those is worth it is the decision here.