Enable all features and document them for docs.rs
This commit is contained in:
parent
758a3f8072
commit
ff32105fce
|
@ -1,14 +1,18 @@
|
|||
[package]
|
||||
edition = "2021"
|
||||
name = "geo-uri"
|
||||
version = "0.1.1"
|
||||
authors = ["Paul van Tilburg <paul@luon.net>"]
|
||||
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"]
|
||||
|
||||
|
|
|
@ -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<GeoUri> 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<Url> for GeoUri {
|
||||
type Error = Error;
|
||||
|
||||
|
|
Loading…
Reference in New Issue