diff --git a/clippy.toml b/clippy.toml index dd79f677..4a70ea47 100644 --- a/clippy.toml +++ b/clippy.toml @@ -3,3 +3,5 @@ # it makes sense to optimize for 64-bit and accept the performance hits on 32-bit. # 16 bytes is the number of bytes that fits into two 64-bit CPU registers. trivial-copy-size-limit = 16 +# Don't warn about these identifiers when using clippy::doc_markdown. +doc-valid-idents = ["Direct2D", "PostScript", ".."] diff --git a/src/affine.rs b/src/affine.rs index f752eba2..0c19a819 100644 --- a/src/affine.rs +++ b/src/affine.rs @@ -78,7 +78,7 @@ impl Affine { /// An affine transform representing a rotation of `th` radians about `center`. /// - /// See [Affine::rotate] for more info. + /// See [`Affine::rotate()`] for more info. #[inline] pub fn rotate_about(th: f64, center: Point) -> Affine { let center = center.to_vec2(); @@ -96,7 +96,7 @@ impl Affine { /// An affine transformation representing a skew. /// - /// The skew_x and skew_y parameters represent skew factors for the + /// The `skew_x` and `skew_y` parameters represent skew factors for the /// horizontal and vertical directions, respectively. /// /// This is commonly used to generate a faux oblique transform for @@ -210,7 +210,7 @@ impl Affine { Affine::rotate(th) * self } - /// `self` followed by a rotation of `th` about `center. + /// `self` followed by a rotation of `th` about `center`. /// /// Equivalent to `Affine::rotate_about(th, center) * self` #[inline] diff --git a/src/bezpath.rs b/src/bezpath.rs index d1ce923c..eddd03e7 100644 --- a/src/bezpath.rs +++ b/src/bezpath.rs @@ -1157,11 +1157,11 @@ impl PathSeg { a } - /// Minimum distance between two PathSegs + /// Minimum distance between two [`PathSeg`]s. /// /// Returns a tuple of the distance, the path time `t1` of the closest point - /// on the first PathSeg, and the path time `t2` of the closest point on the - /// second PathSeg. + /// on the first `PathSeg`, and the path time `t2` of the closest point on the + /// second `PathSeg`. pub fn min_dist(&self, other: PathSeg, accuracy: f64) -> MinDistance { let (distance, t1, t2) = crate::mindist::min_dist_param( &self.as_vec2_vec(), @@ -1648,7 +1648,7 @@ mod tests { assert_eq!(expected_svg, reversed.to_svg()); } - /// https://github.com/fonttools/fonttools/blob/bf265ce49e0cae6f032420a4c80c31d8e16285b8/Tests/pens/reverseContourPen_test.py#L7 + // https://github.com/fonttools/fonttools/blob/bf265ce49e0cae6f032420a4c80c31d8e16285b8/Tests/pens/reverseContourPen_test.py#L7 #[test] fn test_reverse_lines() { let mut path = BezPath::new(); diff --git a/src/lib.rs b/src/lib.rs index 397f4a0b..3c5563a8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -70,7 +70,7 @@ #![forbid(unsafe_code)] #![deny(missing_docs, clippy::trivially_copy_pass_by_ref)] -#![warn(rustdoc::broken_intra_doc_links)] +#![warn(clippy::doc_markdown, rustdoc::broken_intra_doc_links)] #![allow( clippy::unreadable_literal, clippy::many_single_char_names, diff --git a/src/rounded_rect_radii.rs b/src/rounded_rect_radii.rs index fd43a000..de7875a9 100644 --- a/src/rounded_rect_radii.rs +++ b/src/rounded_rect_radii.rs @@ -31,9 +31,9 @@ pub struct RoundedRectRadii { } impl RoundedRectRadii { - /// Create a new RoundedRectRadii. This function takes radius values for - /// the four corners. The argument order is "top_left, top_right, - /// bottom_right, bottom_left", or clockwise starting from top_left. + /// Create a new `RoundedRectRadii`. This function takes radius values for + /// the four corners. The argument order is `top_left`, `top_right`, + /// `bottom_right`, `bottom_left`, or clockwise starting from `top_left`. pub const fn new(top_left: f64, top_right: f64, bottom_right: f64, bottom_left: f64) -> Self { RoundedRectRadii { top_left, @@ -43,7 +43,7 @@ impl RoundedRectRadii { } } - /// Create a new RoundedRectRadii from a single radius. The `radius` + /// Create a new `RoundedRectRadii` from a single radius. The `radius` /// argument will be set as the radius for all four corners. pub const fn from_single_radius(radius: f64) -> Self { RoundedRectRadii { diff --git a/src/svg.rs b/src/svg.rs index 3b380fa8..ecdb1901 100644 --- a/src/svg.rs +++ b/src/svg.rs @@ -393,7 +393,7 @@ impl<'a> SvgLexer<'a> { impl SvgArc { /// Checks that arc is actually a straight line. /// - /// In this case, it can be replaced with a LineTo. + /// In this case, it can be replaced with a `LineTo`. pub fn is_straight_line(&self) -> bool { self.radii.x.abs() <= 1e-5 || self.radii.y.abs() <= 1e-5 || self.from == self.to }