Closed Grinkers closed 3 months ago
https://github.com/edn-rs/edn-rs/pull/150/commits/3965bc3221d79b883a7059d7ce72c4c5c2eee366
I ended up adding a CustomError
fallback for crates like edn-derive
, std-only.
@evaporei Matching PR for compatibility over at (this is a breaking change). Please tell me if you have any better ideas. I believe derive will always rely on std, so it's easy enough to add std stuff without messing with the base layer https://github.com/edn-rs/edn-derive/pull/44
Added a new Error for duplicate in sets, matching clojure.
Sorry for the delay, I'm moving to another city and have had limited time. I can take a look as soon as the branch is updated
Attention: Patch coverage is 77.03927%
with 76 lines
in your changes are missing coverage. Please review.
Project coverage is 71.37%. Comparing base (
c60d05b
) to head (f658a21
).
Files | Patch % | Lines |
---|---|---|
src/deserialize/parse.rs | 81.59% | 53 Missing :warning: |
src/deserialize/mod.rs | 40.00% | 21 Missing :warning: |
src/edn/error.rs | 75.00% | 2 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Sorry for the delay, I'm moving to another city and have had limited time. I can take a look as soon as the branch is updated
No worries, I don't think it's too urgent. It would be nice to be merged in so I can tackle the other issues though. Rebased, which is what I assume you meant. No other changes. Tell me if you want this broken up/squashed in a different way.
I think https://github.com/edn-rs/edn-rs/issues/138 should be a higher priority (github release action -> crates.io publishing). I think we should do a final 0.17 before this PR gets merged too.
Code coverage bot seems really bad? It's marking tons of things as untested.
To compare, here's the source based coverage generated by https://github.com/Grinkers/edn-rs/blob/5ad0427304dc9a05276ef2de36013c82e5ab22e8/bb.edn#L38
Resolves https://github.com/edn-rs/edn-rs/issues/119
Performance
Note this is using the benchmark in
main
branch. The performance increase should be much better on larger strings, as there is now noclone()
in parse. The only allocations are for constructing the EDN struct and for parsing numbers. Note that the walker is now all pointer based. Peeking was a big reason previously for the clones, you can see the new performance characteristics (utf-8 complexity but no allocations) https://godbolt.org/z/zK9dEzrYnBefore
After
Debug
given
Before
Err(ParseEdn("None could not be parsed at char count 58"))
After
Err(EdnError { code: UnexpectedEOF, line: Some(1), column: Some(74), index: Some(73) })
Examples/tests can be seen in https://github.com/Grinkers/edn-rs/blob/parse/tests/error_messages.rsErrors
In this rework, the following strings were also previously being parsed as valid EDN. Fuzzing invalid EDN is still a TODO (separate issue/PR).