diff --git a/Cargo.toml b/Cargo.toml index f2c1e13..6beef49 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,14 +1,18 @@ [package] +edition = "2021" name = "geo-uri" version = "0.1.1" authors = ["Paul van Tilburg "] -edition = "2021" description = "A crate for parsing and generating uniform resource identifiers for geographic locations (geo URIs)" repository = "https://git.luon.net/paul/geo-uri-rs" readme = "README.md" license = "MIT" keywords = ["geolocation", "uri", "parser", "rfc5870"] +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] + [features] url = ["dep:url"] diff --git a/src/lib.rs b/src/lib.rs index 58f7eca..efb6963 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,4 @@ +#![cfg_attr(docsrs, feature(doc_cfg))] #![doc = include_str!("../README.md")] #![warn( clippy::all, @@ -455,6 +456,7 @@ impl fmt::Display for GeoUri { } #[cfg(feature = "url")] +#[cfg_attr(docsrs, doc(cfg(feature = "url")))] impl From<&GeoUri> for Url { fn from(geo_uri: &GeoUri) -> Self { Url::parse(&geo_uri.to_string()).expect("valid URL") @@ -462,6 +464,7 @@ impl From<&GeoUri> for Url { } #[cfg(feature = "url")] +#[cfg_attr(docsrs, doc(cfg(feature = "url")))] impl From for Url { fn from(geo_uri: GeoUri) -> Self { Url::from(&geo_uri) @@ -516,6 +519,7 @@ impl TryFrom<(f64, f64, f64)> for GeoUri { } #[cfg(feature = "url")] +#[cfg_attr(docsrs, doc(cfg(feature = "url")))] impl TryFrom<&Url> for GeoUri { type Error = Error; @@ -525,6 +529,7 @@ impl TryFrom<&Url> for GeoUri { } #[cfg(feature = "url")] +#[cfg_attr(docsrs, doc(cfg(feature = "url")))] impl TryFrom for GeoUri { type Error = Error;