From 01322f69a406eee76014f5e2834336e2295ad80e Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 25 Nov 2020 07:11:27 +0100 Subject: Use recently stabilized intra-doc links See RFC: https://github.com/rust-lang/rfcs/blob/master/text/1946-intra-rustdoc-links.md --- core/src/rectangle.rs | 28 ---------------------------- 1 file changed, 28 deletions(-) (limited to 'core/src/rectangle.rs') diff --git a/core/src/rectangle.rs b/core/src/rectangle.rs index ce80c661..0a7f5fe2 100644 --- a/core/src/rectangle.rs +++ b/core/src/rectangle.rs @@ -19,10 +19,6 @@ pub struct Rectangle { impl Rectangle { /// Creates a new [`Rectangle`] with its top-left corner in the given /// [`Point`] and with the provided [`Size`]. - /// - /// [`Rectangle`]: struct.Rectangle.html - /// [`Point`]: struct.Point.html - /// [`Size`]: struct.Size.html pub fn new(top_left: Point, size: Size) -> Self { Self { x: top_left.x, @@ -34,9 +30,6 @@ impl Rectangle { /// Creates a new [`Rectangle`] with its top-left corner at the origin /// and with the provided [`Size`]. - /// - /// [`Rectangle`]: struct.Rectangle.html - /// [`Size`]: struct.Size.html pub fn with_size(size: Size) -> Self { Self { x: 0.0, @@ -47,50 +40,33 @@ impl Rectangle { } /// Returns the [`Point`] at the center of the [`Rectangle`]. - /// - /// [`Point`]: struct.Point.html - /// [`Rectangle`]: struct.Rectangle.html pub fn center(&self) -> Point { Point::new(self.center_x(), self.center_y()) } /// Returns the X coordinate of the [`Point`] at the center of the /// [`Rectangle`]. - /// - /// [`Point`]: struct.Point.html - /// [`Rectangle`]: struct.Rectangle.html pub fn center_x(&self) -> f32 { self.x + self.width / 2.0 } /// Returns the Y coordinate of the [`Point`] at the center of the /// [`Rectangle`]. - /// - /// [`Point`]: struct.Point.html - /// [`Rectangle`]: struct.Rectangle.html pub fn center_y(&self) -> f32 { self.y + self.height / 2.0 } /// Returns the position of the top left corner of the [`Rectangle`]. - /// - /// [`Rectangle`]: struct.Rectangle.html pub fn position(&self) -> Point { Point::new(self.x, self.y) } /// Returns the [`Size`] of the [`Rectangle`]. - /// - /// [`Size`]: struct.Size.html - /// [`Rectangle`]: struct.Rectangle.html pub fn size(&self) -> Size { Size::new(self.width, self.height) } /// Returns true if the given [`Point`] is contained in the [`Rectangle`]. - /// - /// [`Point`]: struct.Point.html - /// [`Rectangle`]: struct.Rectangle.html pub fn contains(&self, point: Point) -> bool { self.x <= point.x && point.x <= self.x + self.width @@ -99,8 +75,6 @@ impl Rectangle { } /// Computes the intersection with the given [`Rectangle`]. - /// - /// [`Rectangle`]: struct.Rectangle.html pub fn intersection( &self, other: &Rectangle, @@ -127,8 +101,6 @@ impl Rectangle { } /// Snaps the [`Rectangle`] to __unsigned__ integer coordinates. - /// - /// [`Rectangle`]: struct.Rectangle.html pub fn snap(self) -> Rectangle { Rectangle { x: self.x as u32, -- cgit