Skip to content

Commit

Permalink
Work around docs.rs problem with cargo (ref georust#240)
Browse files Browse the repository at this point in the history
  • Loading branch information
spadarian committed Jul 24, 2022
1 parent d640dd7 commit 70df679
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ edition = "2021"
default = []
bindgen = ["gdal-sys/bindgen"]
array = ["ndarray"]
docsrs = []

[dependencies]
thiserror = "1.0"
Expand All @@ -38,3 +39,4 @@ members = ["gdal-sys"]

[package.metadata.docs.rs]
rustc-args = ["--cfg", "docsrs"]
features = [ "docsrs" ]
4 changes: 2 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use std::str::FromStr;

#[cfg(docsrs)]
#[cfg(feature = "docsrs")]
pub fn gdal_version_info(_key: &str) -> String {
"3020000".to_string()
}

#[cfg(not(docsrs))]
#[cfg(not(feature = "docsrs"))]
pub fn gdal_version_info(key: &str) -> String {
let c_key = std::ffi::CString::new(key.as_bytes()).unwrap();

Expand Down

0 comments on commit 70df679

Please sign in to comment.