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

[rust] [rust-server] More abstract functions including integer fitting #13503

Merged
merged 2 commits into from Oct 6, 2022

Conversation

jacob-pro
Copy link
Contributor

This is a follow up to my previous PR (#13231) which moves more functions into the AbstractRustCodgen.

Three simple functions (generatorLanguage, escapeQuotationMark, escapeUnsafeCharacters) are identical and have just been cut-paste / de-duplicated.

The rest of the changes relate to integer fitting. The new integer fitting code should be a lot more straightforward to understand and more consistent. It also has a much more extensive set of test cases that check the key boundary conditions.

This is however a very slightly breaking change, because there are some strange edge cases where the integer handling currently works differently in rust vs rust-server, which have now been smoothed over. Again like the previous PR I have tried to maintain a compromise making the minimum changes to existing behaviour, but also trying to keep the code sane & consistent.

cc: @frol @farcaller @richardwhiuk @paladinzh

@jacob-pro jacob-pro force-pushed the more-abstraction branch 2 times, most recently from d3c22c4 to 6b04e27 Compare September 23, 2022 09:57
@jacob-pro
Copy link
Contributor Author

@wing328 Please review when you have time :)

@wing328
Copy link
Member

wing328 commented Oct 4, 2022

Reviewed with 2 minor suggestions. Generally I'm ok with this change.

@wing328 wing328 added Client: Rust Server: Rust Enhancement: Code Cleanup General refactoring, removal of deprecated things, commenting, etc. labels Oct 4, 2022
@wing328 wing328 added this to the 6.2.1 milestone Oct 4, 2022
@wing328
Copy link
Member

wing328 commented Oct 6, 2022

circleci failure already fixed in master.

@wing328 wing328 merged commit 32936ad into OpenAPITools:master Oct 6, 2022
jayandran-Sampath pushed a commit to jayandran-Sampath/openapi-generator that referenced this pull request Oct 6, 2022
OpenAPITools#13503)

* [rust] [rust-server] Abstract Rust Integer fitting

* Add docstrings
@jacob-pro jacob-pro deleted the more-abstraction branch October 6, 2022 20:59
@wing328
Copy link
Member

wing328 commented Oct 7, 2022

@jacob-pro can you please PM me via Slack when you've time? Thanks.

https://join.slack.com/t/openapi-generator/shared_invite/zt-12jxxd7p2-XUeQM~4pzsU9x~eGLQqX2g

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Client: Rust Enhancement: Code Cleanup General refactoring, removal of deprecated things, commenting, etc. Server: Rust
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants