Giter VIP home page Giter VIP logo

Comments (3)

VictorKoenders avatar VictorKoenders commented on August 24, 2024

09:13:09 < Xion_> https://github.com/Trangar/periodic_table/blob/master/src/main.rs#L89 -- You could wrap the Vec in a newtype and implement Display/Debug on it, it'd give you
access to .debug_struct which is nicer than manual formating of struct decls
09:14:05 < Trangar> Is debug_struct guaranteed to be compileable code?
09:14:20 < Xion_> I think so?
09:15:39 < Xion_> The other obvious thing you could do is introduce more types rather than using strings everywhere
09:15:43 < Xion_> E.g. for atomic mass
09:15:59 < Trangar> The obvious thing would be to just parse the CSV directly to an object that implements Deserialize
09:16:12 < Trangar> And then implement Debug for that that generates the proper code
09:16:21 < Xion_> +1 that's a good idea
09:16:42 < Xion_> It could even be the Element type :D
09:16:51 < Trangar> CsvElement or something

from periodic_table.

Xion avatar Xion commented on August 24, 2024

‹Xion_›  You probably also want to add docs on every field :) E.g. melting/boilingPoint need a reference pressure
‹Xion_›  (and probably an enum rather than Option, because there are three states: Unknown, Known(u32), NotApplicable in case of helium)

from periodic_table.

VictorKoenders avatar VictorKoenders commented on August 24, 2024

(Mostly) closed in #4, #5 and #6 (thanks @noirotm!)

from periodic_table.

Related Issues (6)

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.