Enable all features and document them for docs.rs
This commit is contained in:
parent
758a3f8072
commit
ff32105fce
|
@ -1,14 +1,18 @@
|
||||||
[package]
|
[package]
|
||||||
|
edition = "2021"
|
||||||
name = "geo-uri"
|
name = "geo-uri"
|
||||||
version = "0.1.1"
|
version = "0.1.1"
|
||||||
authors = ["Paul van Tilburg <paul@luon.net>"]
|
authors = ["Paul van Tilburg <paul@luon.net>"]
|
||||||
edition = "2021"
|
|
||||||
description = "A crate for parsing and generating uniform resource identifiers for geographic locations (geo URIs)"
|
description = "A crate for parsing and generating uniform resource identifiers for geographic locations (geo URIs)"
|
||||||
repository = "https://git.luon.net/paul/geo-uri-rs"
|
repository = "https://git.luon.net/paul/geo-uri-rs"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
keywords = ["geolocation", "uri", "parser", "rfc5870"]
|
keywords = ["geolocation", "uri", "parser", "rfc5870"]
|
||||||
|
|
||||||
|
[package.metadata.docs.rs]
|
||||||
|
all-features = true
|
||||||
|
rustdoc-args = ["--cfg", "docsrs"]
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
url = ["dep:url"]
|
url = ["dep:url"]
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#![cfg_attr(docsrs, feature(doc_cfg))]
|
||||||
#![doc = include_str!("../README.md")]
|
#![doc = include_str!("../README.md")]
|
||||||
#![warn(
|
#![warn(
|
||||||
clippy::all,
|
clippy::all,
|
||||||
|
@ -455,6 +456,7 @@ impl fmt::Display for GeoUri {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "url")]
|
#[cfg(feature = "url")]
|
||||||
|
#[cfg_attr(docsrs, doc(cfg(feature = "url")))]
|
||||||
impl From<&GeoUri> for Url {
|
impl From<&GeoUri> for Url {
|
||||||
fn from(geo_uri: &GeoUri) -> Self {
|
fn from(geo_uri: &GeoUri) -> Self {
|
||||||
Url::parse(&geo_uri.to_string()).expect("valid URL")
|
Url::parse(&geo_uri.to_string()).expect("valid URL")
|
||||||
|
@ -462,6 +464,7 @@ impl From<&GeoUri> for Url {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "url")]
|
#[cfg(feature = "url")]
|
||||||
|
#[cfg_attr(docsrs, doc(cfg(feature = "url")))]
|
||||||
impl From<GeoUri> for Url {
|
impl From<GeoUri> for Url {
|
||||||
fn from(geo_uri: GeoUri) -> Self {
|
fn from(geo_uri: GeoUri) -> Self {
|
||||||
Url::from(&geo_uri)
|
Url::from(&geo_uri)
|
||||||
|
@ -516,6 +519,7 @@ impl TryFrom<(f64, f64, f64)> for GeoUri {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "url")]
|
#[cfg(feature = "url")]
|
||||||
|
#[cfg_attr(docsrs, doc(cfg(feature = "url")))]
|
||||||
impl TryFrom<&Url> for GeoUri {
|
impl TryFrom<&Url> for GeoUri {
|
||||||
type Error = Error;
|
type Error = Error;
|
||||||
|
|
||||||
|
@ -525,6 +529,7 @@ impl TryFrom<&Url> for GeoUri {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "url")]
|
#[cfg(feature = "url")]
|
||||||
|
#[cfg_attr(docsrs, doc(cfg(feature = "url")))]
|
||||||
impl TryFrom<Url> for GeoUri {
|
impl TryFrom<Url> for GeoUri {
|
||||||
type Error = Error;
|
type Error = Error;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue