-
Notifications
You must be signed in to change notification settings - Fork 96
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
Added a more ergonomic means of accessing GDAL version properties. #305
Conversation
…e GDAL version and build information.
7695c1d
to
e36286e
Compare
e36286e
to
a3ff46c
Compare
I know that you wanted to make debug-printing to work, but it seems quite convoluted for what it does. I had to go over it three times to spot the pub struct VersionInfo(pub &'static str);
impl VersionInfo {
const RELEASE_NAME: VersionInfo = VersionInfo("RELEASE_NAME");
// ...
fn get_version_info(&self) -> String { todo!() }
fn all() -> String { todo!() }
} (or even just a pair of functions and some constants, without any struct) Let's see how the others feel about it. |
* master: PR feedback. cargo fmt Enabled docs.rs feature gate flag rendering. Clarification of GDAL Programs module. Initial draft of Driver documentation. Lead-in to Raster and Vector sub-modules. Fixed rustdoc warnings in mdarray. Super slimmed down intro example. Simplifying root module docs. Added metadata example. Introduced Driver API.
1ba54c8
to
6c3b34e
Compare
6c3b34e
to
91def41
Compare
@lnicola I turned down the "clever" volume and implemented a more direct approach. What do you think? |
Sure, looks good. r? @jdroenner |
bors r=lnicola |
🔒 Permission denied Existing reviewers: click here to make metasim a reviewer |
bors r+ |
Build succeeded: |
CHANGES.md
if knowledge of this change could be valuable to users.This PR is of minor impact, but does provide some quality-of-life benefits when building systems which need to dynamically check and verify the version of GDAL available at runtime.
GDAL's native query mechanism uses magical tokens that requires either brute memory, or repeated digging through API docs to fetch the particular version property needed. This PR aims to provide a slightly more principled approach to querying this information via a new
enum
calledVersionInfo
. It does not change the existing mechanism, only provides an alternative.