Skip to content

Commit

Permalink
clippy: Fix doc_markdown warnings, enable by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
waywardmonkeys authored and cmyr committed Oct 10, 2023
1 parent 0bdecb8 commit e9d460c
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 13 deletions.
2 changes: 2 additions & 0 deletions clippy.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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", ".."]
6 changes: 3 additions & 3 deletions src/affine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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
Expand Down Expand Up @@ -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]
Expand Down
8 changes: 4 additions & 4 deletions src/bezpath.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions src/rounded_rect_radii.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/svg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit e9d460c

Please sign in to comment.