Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Change formatter result type #1740

Closed
Tracked by #1726
ematipico opened this issue Nov 1, 2021 · 1 comment · Fixed by #1749
Closed
Tracked by #1726

Change formatter result type #1740

ematipico opened this issue Nov 1, 2021 · 1 comment · Fixed by #1749

Comments

@ematipico
Copy link
Contributor

ematipico commented Nov 1, 2021

Change Formatter to return Result<FormatElement, FormatError> instead of an Option. Prevents accidentally returning when skipping an optional element. enum FormatError { MissingNode, UnknownNode } . Implement From<SyntaxError> for FormatError so that the try operator works nicely.

@ematipico
Copy link
Contributor Author

Working on this as it's a direct consequence of #1731

@ematipico ematipico changed the title Change Formatter to return Result<FormatElement, FormatError> instead of an Option. Prevents accidentally returning when skipping an optional element. enum FormatError { MissingNode, UnknownNode } . Implement From<SyntaxError> for FormatError so that the try operator works nicely. Change formatter result type Nov 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant