Skip to content
This repository was archived by the owner on Aug 15, 2025. It is now read-only.

split off BorrowDecode from Decode in bincode_derive#432

Merged
VictorKoenders merged 7 commits intotrunkfrom
feature/split_borrow_derive
Nov 7, 2021
Merged

split off BorrowDecode from Decode in bincode_derive#432
VictorKoenders merged 7 commits intotrunkfrom
feature/split_borrow_derive

Conversation

@VictorKoenders
Copy link
Contributor

We've discussed splitting off Decode from BorrowDecode derive macro before. This PR actualizes that.

This should offer people a solution to issues where the type implements BorrowDecode while people are explicitly requesting Decode. It does not fix the issue around Cow<T> always needing Decode, we can't fix that until specialization implementation.

@codecov-commenter
Copy link

codecov-commenter commented Nov 7, 2021

Codecov Report

Merging #432 (dfdc924) into trunk (4120069) will decrease coverage by 0.48%.
The diff coverage is 8.80%.

Impacted file tree graph

@@            Coverage Diff             @@
##            trunk     #432      +/-   ##
==========================================
- Coverage   71.04%   70.55%   -0.49%     
==========================================
  Files          41       42       +1     
  Lines        2811     2839      +28     
==========================================
+ Hits         1997     2003       +6     
- Misses        814      836      +22     
Impacted Files Coverage Δ
derive/src/derive_enum.rs 0.00% <0.00%> (ø)
derive/src/derive_struct.rs 0.00% <0.00%> (ø)
derive/src/generate/generator.rs 0.00% <ø> (ø)
derive/src/lib.rs 5.33% <0.00%> (-2.08%) ⬇️
src/lib.rs 100.00% <ø> (ø)
tests/derive.rs 100.00% <ø> (ø)
tests/utils.rs 95.23% <ø> (ø)
src/features/impl_alloc.rs 100.00% <100.00%> (ø)
tests/alloc.rs 100.00% <100.00%> (ø)
tests/issues/issue_431.rs 100.00% <100.00%> (ø)
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4120069...dfdc924. Read the comment docs.

@VictorKoenders
Copy link
Contributor Author

I've taken the liberty to also re-export the Decode and Encode trait in the root of the crate, as these are used often

@VictorKoenders VictorKoenders force-pushed the feature/split_borrow_derive branch from 14b6b89 to b196fde Compare November 7, 2021 09:49
@VictorKoenders VictorKoenders merged commit a3a3aed into trunk Nov 7, 2021
@VictorKoenders VictorKoenders deleted the feature/split_borrow_derive branch November 7, 2021 09:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants