-
Notifications
You must be signed in to change notification settings - Fork 48
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
Allow creating a Proj from an owned String #193
Conversation
CString::new takes any Into<Vec<u8>>, which includes String. This should make it possible to avoid reallocating when passing in an owned String with sufficient capacity.
The test failures were caused by some doctests calling Proj::new_known_crs(&from, &to, None) where |
I think the |
I think the existing type signature is going to be more intuitive for the caller. If I'm understanding your motivation, having to type in a Unless I'm misunderstanding, I don't think we should merge this. |
Sorry, I missed your initial comment that this is about avoiding re-allocation inside of CString. But my conclusion is the same - it seems unlikely that gains here will be worth having a more opaque/confusing input type. Are you experiencing this part of the code as a bottleneck? |
I just find it a bit odd for Having had another look, I don't think this is performance-critical for us, so I don't mind if you don't think it's worth it. The type could also be |
FWIW, in
|
I appreciate the attempt, but I think on balance this is not worthwhile, so closing. |
CString::new
takes anyInto<Vec<u8>>
, which includesString
. This should make it possible to avoid reallocating when passing in an ownedString
with sufficient capacity.