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

Refactor to use strongly typed data structures #27

Merged
merged 8 commits into from
May 16, 2021

Conversation

Hamatti
Copy link
Owner

@Hamatti Hamatti commented Apr 24, 2021

This increases the stability of the application but also makes it
much easier to read.

So many unwraps and type casts removed.

Will need to test in action for a few nights to make sure there were no extra mistakes.

src/api_types.rs Outdated
}

#[derive(Debug, Serialize, Deserialize)]
#[allow(non_snake_case)]
Copy link

@PatatasDelPapa PatatasDelPapa May 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use snake_case variable names while reciving camelCase if instead of #[allow(non_snake_case)] you use #[serde(rename_all = "camelCase")]. I got this info from the serde book if you interested.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much! That's exactly what I want to do but couldn't figure out how.

@Hamatti Hamatti merged commit 936c432 into master May 16, 2021
@Hamatti Hamatti deleted the refactor/serde-values branch May 16, 2021 12:30
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.

2 participants