Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid stringly-typed APIs in several spots #74

Merged
merged 5 commits into from
Jan 17, 2020

Conversation

notriddle
Copy link
Contributor

@notriddle notriddle commented Dec 27, 2019

From the "let the knife do the work" school of Rust, this pull request has a net reduction of about twenty lines by avoiding manual stringification in favour of implementing the serde traits directly on the corresponding API types.

For more information on some of what I'm doing here, read https://serde.rs/container-attrs.html.

Also fixes #49; instead of implementing Display, it implements Serialize.

@codecov-io
Copy link

codecov-io commented Dec 30, 2019

Codecov Report

Merging #74 into master will increase coverage by 0.27%.
The diff coverage is 58.82%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #74      +/-   ##
==========================================
+ Coverage    50.5%   50.77%   +0.27%     
==========================================
  Files          24       24              
  Lines        1689     1668      -21     
==========================================
- Hits          853      847       -6     
+ Misses        836      821      -15
Impacted Files Coverage Δ
src/core/receive.rs 91.11% <ø> (ø) ⬆️
src/core/send.rs 82.35% <ø> (ø) ⬆️
src/core/mailbox.rs 52.88% <ø> (+0.5%) ⬆️
src/core/api.rs 28.57% <ø> (-3.51%) ⬇️
src/core.rs 69.11% <100%> (-1.72%) ⬇️
src/core/timing.rs 90.47% <100%> (ø) ⬆️
src/core/order.rs 89.28% <100%> (+3.07%) ⬆️
src/core/server_messages.rs 100% <100%> (ø) ⬆️
src/core/rendezvous.rs 52.04% <16.66%> (+0.3%) ⬆️
src/core/boss.rs 26.41% <50%> (-0.3%) ⬇️
... and 8 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 5b63d5d...d42d623. Read the comment docs.

@warner
Copy link
Collaborator

warner commented Jan 17, 2020

thanks! that's awesome, I learn more about Rust every day :)

@warner warner merged commit d42d623 into magic-wormhole:master Jan 17, 2020
@notriddle notriddle deleted the serde-protocol branch January 17, 2020 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

use Display, not custom to_string, for Mood
3 participants