Created by: jacob-pro
This is a follow up to my previous PR (https://github.com/OpenAPITools/openapi-generator/pull/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