Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Fixes leakage of GDALDataType::Type in RasterBand. #334
Fixes leakage of GDALDataType::Type in RasterBand. #334
Changes from 3 commits
0916638
66e87f6
bb98976
86f90e3
739750d
1c07337
a577a93
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just looking at the code in the browser, can we call
GdalType::datatype()
here instead?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lnicola Not sure what you mean...
GdalType::datatype()
would be to get the datatype most closely associated with a static primitive. In this case, we're getting ac_int
from C-GDAL and need to map that into theGdalDataType
enum. But perhaps I'm missing what you're suggesting?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically
ordinal.datatype()
instead ofordinal.try_into().unwrap_or(GdalDataType::Unknown)
. Maybe it doesn't work forc_int
, though?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeh, it doesn't work.
GdalType
is a (wierd) type-level trait, with noself
parameter:gdal/src/raster/types.rs
Line 330 in 029b95a
In Scala I'd have called this an "evidence" trait. So
<u8>::datatype()
exists, but3u8.datatype()
does not.