doc tweaks

This commit is contained in:
Trevor Spiteri 2019-01-28 19:59:27 +01:00
parent 2a7cf2c4b5
commit e8af3cf2e7
2 changed files with 5 additions and 3 deletions

View File

@ -1032,7 +1032,7 @@ macro_rules! fixed {
concat!( concat!(
"Creates a fixed-point number from a floating-point number.\n", "Creates a fixed-point number from a floating-point number.\n",
"\n", "\n",
"Returns a tuple of the fixed-point number and a boolean indicating whether\n", "Returns a tuple of the fixed-point number and a [`bool`] indicating whether\n",
"an overflow has occurred. On overflow, the wrapped value is returned.\n", "an overflow has occurred. On overflow, the wrapped value is returned.\n",
"\n", "\n",
"The floating-point value can be of type [`f32`] or [`f64`].\n", "The floating-point value can be of type [`f32`] or [`f64`].\n",
@ -1066,6 +1066,7 @@ macro_rules! fixed {
"assert_eq!(Fix::overflowing_from_float(large), (wrapped, true));\n", "assert_eq!(Fix::overflowing_from_float(large), (wrapped, true));\n",
"```\n", "```\n",
"\n", "\n",
"[`bool`]: https://doc.rust-lang.org/nightly/std/primitive.bool.html\n",
"[`f16` feature]: index.html#optional-features\n", "[`f16` feature]: index.html#optional-features\n",
"[`f16`]: https://docs.rs/half/^1.2/half/struct.f16.html\n", "[`f16`]: https://docs.rs/half/^1.2/half/struct.f16.html\n",
"[`f32`]: https://doc.rust-lang.org/nightly/std/primitive.f32.html\n", "[`f32`]: https://doc.rust-lang.org/nightly/std/primitive.f32.html\n",

View File

@ -49,15 +49,16 @@ use {
pub trait Int: SealedInt {} pub trait Int: SealedInt {}
/// This trait is implemented for the primitive floating-point types, /// This trait is implemented for the primitive floating-point types,
/// and for [`f16`] if the `f16` feature is enabled. /// and for [`f16`] if the [`f16` feature] is enabled.
/// ///
/// This trait is sealed and cannot be implemented for more types; it /// This trait is sealed and cannot be implemented for more types; it
/// is implemented for [`f32`] and [`f64`], and for [`f16`] if the /// is implemented for [`f32`] and [`f64`], and for [`f16`] if the
/// `f16` feature is enabled. /// [`f16` feature] is enabled.
/// ///
/// [`f16`]: https://docs.rs/half/^1.2/half/struct.f16.html /// [`f16`]: https://docs.rs/half/^1.2/half/struct.f16.html
/// [`f32`]: https://doc.rust-lang.org/nightly/std/primitive.f32.html /// [`f32`]: https://doc.rust-lang.org/nightly/std/primitive.f32.html
/// [`f64`]: https://doc.rust-lang.org/nightly/std/primitive.f64.html /// [`f64`]: https://doc.rust-lang.org/nightly/std/primitive.f64.html
/// [`f16` feature]: ../index.html#optional-features
pub trait Float: SealedFloat {} pub trait Float: SealedFloat {}
/// This trait is implemented for all the fixed-point types. /// This trait is implemented for all the fixed-point types.