Conversation
|
Thanks for the PR. I will likely review it this weekend. |
|
@gsquire I tried to integrate/test my changes in one of our apps. The values in SGMap can be Cow to cover more cases. Even I'm also thinking to change: to: and something like: and the merge will happen lazily in the If we choose the latest method, something like this can also happen to |
This comment was marked as outdated.
This comment was marked as outdated.
|
Hi, @omid. The changes LGTM overall. Can you share more about why you want to change from
So long as |
|
Thanks for checking the pr @gsquire SGMap is used as an argument in 3-4 functions. In any of the scenarios, they should be references. Excluding the change above, I kinda proposed 3 ways to solve the cloning issue in SGMap.
I implemented all these method in one of my projects, the first solution had the least clone, then (most probably) 2nd, and then 3rd. If you are perfectionist 😁 we can continue with the existing PR. If you are ignorant 😅 we can go with the last one. And if you are kinda both, 2nd is the way. 😬 I hope it's clearer now 🙏🏼 |
|
I think the change in this PR is fine for now. If you want to experiment some more and send a subsequent patch, I'll happily review it again. I'll merge this. |
|
Thanks, I'm also a perfectionist 😁 so I prefer this PR. |
|
Thanks again! I published the new version just now. |
Basically, it doesn't that much make sense to accept owned
Stringin the structs.So I changed all of them in the public API to
&strand just in one case change it toCow.It's a breaking change, but very useful IMO, because this library is just a middleware to convert a set of input params to a request and doesn't need the ownership.
It can happen a lot to send multiple emails/request for one set of params. So it makes sense to get them as reference as much as possible.