Closed stephan57160 closed 2 years ago
Then, I don't see yet why there is a test case failure ...
Thanks for PR, I don't like cloning on every lookup, but I suppose this is can be addressed later.
I don't like it either, but did not find anything better, for now... Thx to accept it anyway.
As discussed on #435, the code generation may create duplicate generated code. Most of the time, it's harmless, but it may bring troubles later or with other parts of code.
This happens in the following scenario when there is a function having a Vec in parameter and another one as return value:
If there is :
In this fix, a
foreign_code_cache
is added toCppContext
. This cache is checked before writing fromcpp-include.rs
code rules. When the code entry is already present in the cache, it's no more written to FileWriteCache.