diff options
author | 2020-11-25 05:26:03 +0100 | |
---|---|---|
committer | 2020-11-26 01:59:20 +0100 | |
commit | 08e0b9ffbd931928ad10c0147b84c09ce083276d (patch) | |
tree | 617363949940deae2f470d86a08b8bbac29fdae7 | |
parent | bffaeed9fd44619491c012cd9270043828c1849c (diff) | |
download | iced-08e0b9ffbd931928ad10c0147b84c09ce083276d.tar.gz iced-08e0b9ffbd931928ad10c0147b84c09ce083276d.tar.bz2 iced-08e0b9ffbd931928ad10c0147b84c09ce083276d.zip |
Fix broken links in API documentation
-rw-r--r-- | core/src/color.rs | 25 | ||||
-rw-r--r-- | graphics/src/backend.rs | 6 | ||||
-rw-r--r-- | graphics/src/window/gl_compositor.rs | 27 | ||||
-rw-r--r-- | native/src/widget/pane_grid/configuration.rs | 12 | ||||
-rw-r--r-- | web/src/lib.rs | 2 |
5 files changed, 18 insertions, 54 deletions
diff --git a/core/src/color.rs b/core/src/color.rs index a4c3d87c..c66ee97c 100644 --- a/core/src/color.rs +++ b/core/src/color.rs @@ -43,8 +43,6 @@ impl Color { /// /// In debug mode, it will panic if the values are not in the correct /// range: 0.0 - 1.0 - /// - /// [`Color`]: struct.Color.html pub fn new(r: f32, g: f32, b: f32, a: f32) -> Color { debug_assert!( (0.0..=1.0).contains(&r), @@ -67,29 +65,21 @@ impl Color { } /// Creates a [`Color`] from its RGB components. - /// - /// [`Color`]: struct.Color.html pub const fn from_rgb(r: f32, g: f32, b: f32) -> Color { Color::from_rgba(r, g, b, 1.0f32) } /// Creates a [`Color`] from its RGBA components. - /// - /// [`Color`]: struct.Color.html pub const fn from_rgba(r: f32, g: f32, b: f32, a: f32) -> Color { Color { r, g, b, a } } /// Creates a [`Color`] from its RGB8 components. - /// - /// [`Color`]: struct.Color.html pub fn from_rgb8(r: u8, g: u8, b: u8) -> Color { Color::from_rgba8(r, g, b, 1.0) } /// Creates a [`Color`] from its RGB8 components and an alpha value. - /// - /// [`Color`]: struct.Color.html pub fn from_rgba8(r: u8, g: u8, b: u8, a: f32) -> Color { Color { r: f32::from(r) / 255.0, @@ -100,8 +90,6 @@ impl Color { } /// Converts the [`Color`] into its linear values. - /// - /// [`Color`]: struct.Color.html pub fn into_linear(self) -> [f32; 4] { // As described in: // https://en.wikipedia.org/wiki/SRGB#The_reverse_transformation @@ -122,8 +110,6 @@ impl Color { } /// Inverts the [`Color`] in-place. - /// - /// [`Color`]: struct.Color.html pub fn invert(&mut self) { self.r = 1.0f32 - self.r; self.b = 1.0f32 - self.g; @@ -131,8 +117,6 @@ impl Color { } /// Returns the inverted [`Color`]. - /// - /// [`Color`]: struct.Color.html pub fn inverse(self) -> Color { Color::new(1.0f32 - self.r, 1.0f32 - self.g, 1.0f32 - self.b, self.a) } @@ -152,8 +136,6 @@ impl From<[f32; 4]> for Color { #[cfg(feature = "palette")] /// Converts from palette's `Srgba` type to a [`Color`]. -/// -/// [`Color`]: struct.Color.html impl From<Srgba> for Color { fn from(srgba: Srgba) -> Self { Color::new(srgba.red, srgba.green, srgba.blue, srgba.alpha) @@ -162,8 +144,6 @@ impl From<Srgba> for Color { #[cfg(feature = "palette")] /// Converts from [`Color`] to palette's `Srgba` type. -/// -/// [`Color`]: struct.Color.html impl From<Color> for Srgba { fn from(c: Color) -> Self { Srgba::new(c.r, c.g, c.b, c.a) @@ -172,8 +152,6 @@ impl From<Color> for Srgba { #[cfg(feature = "palette")] /// Converts from palette's `Srgb` type to a [`Color`]. -/// -/// [`Color`]: struct.Color.html impl From<Srgb> for Color { fn from(srgb: Srgb) -> Self { Color::new(srgb.red, srgb.green, srgb.blue, 1.0) @@ -182,9 +160,6 @@ impl From<Srgb> for Color { #[cfg(feature = "palette")] /// Converts from [`Color`] to palette's `Srgb` type. -/// -/// [`Color`]: struct.Color.html -/// [`Srgb`]: ../palette/rgb/type.Srgb.html impl From<Color> for Srgb { fn from(c: Color) -> Self { Srgb::new(c.r, c.g, c.b) diff --git a/graphics/src/backend.rs b/graphics/src/backend.rs index dd7dbbc2..da110e46 100644 --- a/graphics/src/backend.rs +++ b/graphics/src/backend.rs @@ -22,12 +22,12 @@ pub trait Text { /// The `char` representing a ✔ icon in the [`ICON_FONT`]. /// - /// [`ICON_FONT`]: #associatedconst.ICON_FONT + /// [`ICON_FONT`]: Self::ICON_FONT const CHECKMARK_ICON: char; - /// The `char` representing a ▼ icon in the built-in [`ICONS`] font. + /// The `char` representing a ▼ icon in the built-in [`ICON_FONT`]. /// - /// [`ICON_FONT`]: #associatedconst.ICON_FONT + /// [`ICON_FONT`]: Self::ICON_FONT const ARROW_DOWN_ICON: char; /// Returns the default size of text. diff --git a/graphics/src/window/gl_compositor.rs b/graphics/src/window/gl_compositor.rs index 1f37642e..34d70be3 100644 --- a/graphics/src/window/gl_compositor.rs +++ b/graphics/src/window/gl_compositor.rs @@ -15,28 +15,27 @@ use core::ffi::c_void; /// If you implement an OpenGL renderer, you can implement this trait to ease /// integration with existing windowing shells, like `iced_glutin`. pub trait GLCompositor: Sized { - /// The renderer of the [`Compositor`]. + /// The renderer of the [`GLCompositor`]. /// /// This should point to your renderer type, which could be a type alias /// of the [`Renderer`] provided in this crate with with a specific /// [`Backend`]. /// - /// [`Compositor`]: trait.Compositor.html - /// [`Renderer`]: ../struct.Renderer.html - /// [`Backend`]: ../backend/trait.Backend.html + /// [`Renderer`]: crate::Renderer + /// [`Backend`]: crate::Backend type Renderer: iced_native::Renderer; - /// The settings of the [`Compositor`]. + /// The settings of the [`GLCompositor`]. /// /// It's up to you to decide the configuration supported by your renderer! type Settings: Default; - /// Creates a new [`Compositor`] and [`Renderer`] with the given + /// Creates a new [`GLCompositor`] and [`Renderer`] with the given /// [`Settings`] and an OpenGL address loader function. /// - /// [`Compositor`]: trait.Compositor.html - /// [`Renderer`]: #associatedtype.Renderer - /// [`Backend`]: ../backend/trait.Backend.html + /// [`Renderer`]: crate::Renderer + /// [`Backend`]: crate::Backend + /// [`Settings`]: Self::Settings #[allow(unsafe_code)] unsafe fn new( settings: Self::Settings, @@ -44,19 +43,15 @@ pub trait GLCompositor: Sized { ) -> Result<(Self, Self::Renderer), Error>; /// Returns the amount of samples that should be used when configuring - /// an OpenGL context for this [`Compositor`]. - /// - /// [`Compositor`]: trait.Compositor.html + /// an OpenGL context for this [`GLCompositor`]. fn sample_count(settings: &Self::Settings) -> u32; - /// Resizes the viewport of the [`Compositor`]. - /// - /// [`Compositor`]: trait.Compositor.html + /// Resizes the viewport of the [`GLCompositor`]. fn resize_viewport(&mut self, physical_size: Size<u32>); /// Draws the provided output with the given [`Renderer`]. /// - /// [`Compositor`]: trait.Compositor.html + /// [`Renderer`]: crate::Renderer fn draw<T: AsRef<str>>( &mut self, renderer: &mut Self::Renderer, diff --git a/native/src/widget/pane_grid/configuration.rs b/native/src/widget/pane_grid/configuration.rs index 1fed98b7..4c43826e 100644 --- a/native/src/widget/pane_grid/configuration.rs +++ b/native/src/widget/pane_grid/configuration.rs @@ -2,7 +2,7 @@ use crate::pane_grid::Axis; /// The arrangement of a [`PaneGrid`]. /// -/// [`PaneGrid`]: struct.PaneGrid.html +/// [`PaneGrid`]: crate::pane_grid::PaneGrid #[derive(Debug, Clone)] pub enum Configuration<T> { /// A split of the available space. @@ -13,18 +13,14 @@ pub enum Configuration<T> { /// The ratio of the split in [0.0, 1.0]. ratio: f32, - /// The left/top [`Content`] of the split. - /// - /// [`Configuration`]: enum.Node.html + /// The left/top [`Configuration`] of the split. a: Box<Configuration<T>>, - /// The right/bottom [`Content`] of the split. - /// - /// [`Configuration`]: enum.Node.html + /// The right/bottom [`Configuration`] of the split. b: Box<Configuration<T>>, }, /// A [`Pane`]. /// - /// [`Pane`]: struct.Pane.html + /// [`Pane`]: crate::pane_grid::Pane Pane(T), } diff --git a/web/src/lib.rs b/web/src/lib.rs index b7970c56..230deb44 100644 --- a/web/src/lib.rs +++ b/web/src/lib.rs @@ -97,8 +97,6 @@ pub use executor::Executor; pub trait Application { /// The [`Executor`] that will run commands and subscriptions. /// - /// The [`executor::WasmBindgen`] can be a good choice for the Web. - /// /// [`Executor`]: trait.Executor.html /// [`executor::Default`]: executor/struct.Default.html type Executor: Executor; |