Fix links in README

In rustdoc, the crate's own types don't need to be linked, but for some
web view that uses plain Markdown, the links looked weird. Fix this by
linkin the crates' own types too.
This commit is contained in:
Paul van Tilburg 2022-10-13 19:30:40 +02:00
parent 129b29da26
commit f00fbc76ab
Signed by: paul
GPG Key ID: C6DE073EDA9EEC4D
1 changed files with 10 additions and 9 deletions

View File

@ -24,7 +24,7 @@ $ cargo add geo-uri
Use either the [`TryFrom`](std::convert::TryFrom) trait or the Use either the [`TryFrom`](std::convert::TryFrom) trait or the
[`parse`](str::parse) method on strings to parse a geo URI string into a [`parse`](str::parse) method on strings to parse a geo URI string into a
[`GeoUri`] struct: [`GeoUri`](GeoUri) struct:
```rust ```rust
use geo_uri::GeoUri; use geo_uri::GeoUri;
@ -56,8 +56,8 @@ assert_eq!(geo_uri.uncertainty(), None);
### Generating ### Generating
Use the [`GeoUriBuilder`] to construct a [`GeoUri`] struct. Use the [`GeoUriBuilder`](GeoUriBuilder) to construct a [`GeoUri`](GeoUri)
Then, use either the [`ToString`](std::string::ToString) or struct. Then, use either the [`ToString`](std::string::ToString) or
[`Display`](std::fmt::Display) trait to generate a geo URI string: [`Display`](std::fmt::Display) trait to generate a geo URI string:
```rust ```rust
@ -80,8 +80,8 @@ assert_eq!(
); );
``` ```
It is also possible to construct a [`GeoUri`] struct from coordinate tuples It is also possible to construct a [`GeoUri`](GeoUri) struct from coordinate
using the [`TryFrom`](std::convert::TryFrom) trait: tuples using the [`TryFrom`](std::convert::TryFrom) trait:
```rust ```rust
use geo_uri::GeoUri; use geo_uri::GeoUri;
@ -115,13 +115,14 @@ let geo_url = Url::from(geo_uri);
assert_eq!(url, geo_url); assert_eq!(url, geo_url);
``` ```
Note that it is always possible to transform a [`GeoUri`] into an [`Url`], but Note that it is always possible to transform a [`GeoUri`](GeoUri) into an
not always the other way around! This is because the format of the coordinates [`Url`](https://docs.rs/url/2/url/struct.Url.html), but not always the other
and parameters after the URI scheme "geo:" may be invalid! way around! This is because the format of the coordinates and parameters after
the URI scheme "geo:" may be invalid!
### Feature: `serde` ### Feature: `serde`
If you enable the `serde` feature, [`GeoUri`] will implement If you enable the `serde` feature, [`GeoUri`](GeoUri) will implement
[`serde::Serialize`](https://docs.rs/serde/1/serde/trait.Serialize.html) and [`serde::Serialize`](https://docs.rs/serde/1/serde/trait.Serialize.html) and
[`serde::Deserialize`](https://docs.rs/serde/1/serde/trait.Deserialize.html). [`serde::Deserialize`](https://docs.rs/serde/1/serde/trait.Deserialize.html).
See the [serde](https://serde.rs) documentation for more information. See the [serde](https://serde.rs) documentation for more information.