Comments (3)
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_› 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.
(Mostly) closed in #4, #5 and #6 (thanks @noirotm!)
from periodic_table.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from periodic_table.