Skip to content

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

Merged
wing328 merged 2 commits intoOpenAPITools:masterfrom
jacob-pro:more-abstraction
Oct 6, 2022
Merged

[rust] [rust-server] More abstract functions including integer fitting#13503
wing328 merged 2 commits intoOpenAPITools:masterfrom
jacob-pro:more-abstraction

Conversation

@jacob-pro
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

@wing328 Please review when you have time :)

@wing328
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member

wing328 commented Oct 7, 2022

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.

2 participants