Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IGC file writer #6

Closed
Turbo87 opened this issue Jan 3, 2019 · 8 comments
Closed

IGC file writer #6

Turbo87 opened this issue Jan 3, 2019 · 8 comments
Labels
enhancement New feature or request

Comments

@Turbo87
Copy link
Contributor

Turbo87 commented Jan 3, 2019

While the README claims that this is only a parser, the low-level nature of the structs seems to make it relatively straight-forward to implement writers for them too. Have you thought about that yet, or is that out-of-scope for this crate?

I'm asking because of the discussion in Turbo87/ogn-web-gateway#11

@Joey9801
Copy link
Owner

Joey9801 commented Jan 3, 2019

I hadn't thought of that yet, but you're right that it would be fairly straightforward to add. I'm happy to do so, though feel free to open a PR :)

@Joey9801 Joey9801 added the enhancement New feature or request label Jan 3, 2019
@Turbo87
Copy link
Contributor Author

Turbo87 commented Jan 4, 2019

@estk do you want to look into that?

@Joey9801
Copy link
Owner

Joey9801 commented Jan 4, 2019

On further thought, implementing formatters for the various record types will actually help with adding property testing, as it enables property tests of the form format!("{}", rec).parse::<Record>() == rec.

@Turbo87
Copy link
Contributor Author

Turbo87 commented Jan 4, 2019

yep, although I'm wondering if the formatters should return Result to in case of invalid values 🤔

@estk
Copy link

estk commented Jan 7, 2019

@Turbo87 @Joey9801 I'd be happy to look into this, might be a few weeks though.

@Joey9801
Copy link
Owner

Joey9801 commented Jan 7, 2019

@Turbo87 - I think it's more idiomatic to make it impossible to create invalid record structs - every sane instance of a record struct has a single well defined string representation.

@estk - I started having a look at implementing this over the weekend, I have just opened a WIP PR (#15) to track it.

@Turbo87
Copy link
Contributor Author

Turbo87 commented Jan 7, 2019

I think it's more idiomatic to make it impossible to create invalid record structs - every sane instance of a record struct has a single well defined string representation.

yeah, that makes sense to me. just wondering how to implement that. are you thinking about a builder pattern kind of thing?

@Joey9801
Copy link
Owner

Implemented in #15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants