Giter Club home page Giter Club logo

Comments (8)

Joey9801 avatar Joey9801 commented on June 11, 2024 1

@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.

from igc-rs.

Joey9801 avatar Joey9801 commented on June 11, 2024

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 :)

from igc-rs.

Turbo87 avatar Turbo87 commented on June 11, 2024

@estk do you want to look into that?

from igc-rs.

Joey9801 avatar Joey9801 commented on June 11, 2024

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.

from igc-rs.

Turbo87 avatar Turbo87 commented on June 11, 2024

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

from igc-rs.

estk avatar estk commented on June 11, 2024

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

from igc-rs.

Turbo87 avatar Turbo87 commented on June 11, 2024

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?

from igc-rs.

Joey9801 avatar Joey9801 commented on June 11, 2024

Implemented in #15

from igc-rs.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.