ralexstokes / ssz-rs

Implementation of ethereum's `ssz`
Apache License 2.0
102 stars 40 forks source link

Make `no_std` build work with `serde` feature enabled #58

Closed aeryz closed 1 year ago

aeryz commented 1 year ago

when serde feature is enabled in a no_std build, it fails due to the references to std. This PR makes serde feature compatible with no_std.

Note that thiserror is completely removed because it doesn't support no_std.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage has no change and project coverage change: +29.64 :tada:

Comparison is base (2300ff8) 44.28% compared to head (51f852a) 73.93%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #58 +/- ## =========================================== + Coverage 44.28% 73.93% +29.64% =========================================== Files 20 18 -2 Lines 1409 844 -565 =========================================== Hits 624 624 + Misses 785 220 -565 ``` | [Impacted Files](https://app.codecov.io/gh/ralexstokes/ssz-rs/pull/58?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alex+Stokes) | Coverage Δ | | |---|---|---| | [ssz-rs/src/lib.rs](https://app.codecov.io/gh/ralexstokes/ssz-rs/pull/58?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alex+Stokes#diff-c3N6LXJzL3NyYy9saWIucnM=) | `100.00% <ø> (ø)` | | | [ssz-rs/src/list.rs](https://app.codecov.io/gh/ralexstokes/ssz-rs/pull/58?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alex+Stokes#diff-c3N6LXJzL3NyYy9saXN0LnJz) | `75.00% <ø> (ø)` | | | [ssz-rs/src/serde.rs](https://app.codecov.io/gh/ralexstokes/ssz-rs/pull/58?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alex+Stokes#diff-c3N6LXJzL3NyYy9zZXJkZS5ycw==) | `70.00% <0.00%> (-30.00%)` | :arrow_down: | | [ssz-rs/src/vector.rs](https://app.codecov.io/gh/ralexstokes/ssz-rs/pull/58?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alex+Stokes#diff-c3N6LXJzL3NyYy92ZWN0b3IucnM=) | `83.33% <ø> (ø)` | | ... and [2 files with indirect coverage changes](https://app.codecov.io/gh/ralexstokes/ssz-rs/pull/58/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Alex+Stokes)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.