brandonchinn178 / toml-reader

Haskell library for parsing v1.0 TOML files
https://hackage.haskell.org/package/toml-reader
BSD 3-Clause "New" or "Revised" License
13 stars 6 forks source link

Add 'getFieldOr' helper #14

Closed rvarago closed 1 year ago

rvarago commented 1 year ago

Hi,

Thanks for this nice library!

I took the liberty of putting a small patch together. Let me know your thoughts.


This small helper is meant to handle the case where there's a sensible default value for a potentially missing key.

Resolves #10

codecov-commenter commented 1 year ago

Codecov Report

Merging #14 (ca65967) into main (86b0e2c) will increase coverage by 0.06%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main      #14      +/-   ##
==========================================
+ Coverage   57.72%   57.78%   +0.06%     
==========================================
  Files           6        6              
  Lines         693      694       +1     
  Branches       19       19              
==========================================
+ Hits          400      401       +1     
  Misses        287      287              
  Partials        6        6              
Impacted Files Coverage Δ
src/TOML/Decode.hs 50.25% <100.00%> (+0.25%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us.

brandonchinn178 commented 1 year ago

@rvarago can you fix formatting per ci?

brandonchinn178 commented 1 year ago

Can you also update the changelog?

rvarago commented 1 year ago

@brandonchinn178

Oops. I forgot to run fourmolu just before pushing the patch :see_no_evil:, sorry!

Sure. It's done, both.

brandonchinn178 commented 1 year ago

Can you change the markdown bullet point back? I don't want to introduce a bad merge conflict for the other PR

rvarago commented 1 year ago

Can you change the markdown bullet point back? I don't want to introduce a bad merge conflict for the other PR

Absolutely. It shouldn't be there in the first place, my editor might've re-written it and I didn't pre-review the patch properly before pushing it.

Done.

brandonchinn178 commented 1 year ago

Thanks a ton!