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

Use DeserializeOwned instead of Deserialize for ModelingCmdVariant #32

Merged
merged 2 commits into from
Dec 15, 2023

Conversation

adamchalmers
Copy link
Collaborator

@adamchalmers adamchalmers commented Dec 15, 2023

Deserialize<'de> lets your structs borrow their data from the serialized bytes/JSON string (for the lifetime 'de, i.e. the serialized bytes must live for 'de or longer). But we aren't borrowing any data in our ModelingCmd. So we're having the downsides (wrangling lifetimes) without the upsides (efficient data).

Right now it's fine for these structs to copy data so I'm going to use DeserializeOwned.

Deserialize<'de> lets your structs borrow their data from the serialized bytes/JSON string. But we aren't borrowing any data in our ModelingCmd. So we're having the downsides (wrangling lifetimes) without the upsides (efficient data).

Right now it's fine for these structs to copy data so I'm going to use DeserializeOwned.
@adamchalmers adamchalmers force-pushed the achalmers/deserialize-owned-only branch from d5d8330 to f87cd5c Compare December 15, 2023 00:27
Copy link

codecov bot commented Dec 15, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (main@5b206c3). Click here to learn what that means.

❗ Current head f87cd5c differs from pull request most recent head 1c63fad. Consider uploading reports for the commit 1c63fad to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #32   +/-   ##
=======================================
  Coverage        ?   25.79%           
=======================================
  Files           ?       28           
  Lines           ?     1407           
  Branches        ?        0           
=======================================
  Hits            ?      363           
  Misses          ?     1044           
  Partials        ?        0           
Flag Coverage Δ
unittests 25.79% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@adamchalmers adamchalmers merged commit ec4ffee into main Dec 15, 2023
6 checks passed
@adamchalmers adamchalmers deleted the achalmers/deserialize-owned-only branch December 15, 2023 00:32
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.

1 participant