Skip to content

Commit e9d460c

Browse files
waywardmonkeyscmyr
authored andcommitted
clippy: Fix doc_markdown warnings, enable by default.
1 parent 0bdecb8 commit e9d460c

File tree

6 files changed

+15
-13
lines changed

6 files changed

+15
-13
lines changed

clippy.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33
# it makes sense to optimize for 64-bit and accept the performance hits on 32-bit.
44
# 16 bytes is the number of bytes that fits into two 64-bit CPU registers.
55
trivial-copy-size-limit = 16
6+
# Don't warn about these identifiers when using clippy::doc_markdown.
7+
doc-valid-idents = ["Direct2D", "PostScript", ".."]

src/affine.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ impl Affine {
7878

7979
/// An affine transform representing a rotation of `th` radians about `center`.
8080
///
81-
/// See [Affine::rotate] for more info.
81+
/// See [`Affine::rotate()`] for more info.
8282
#[inline]
8383
pub fn rotate_about(th: f64, center: Point) -> Affine {
8484
let center = center.to_vec2();
@@ -96,7 +96,7 @@ impl Affine {
9696

9797
/// An affine transformation representing a skew.
9898
///
99-
/// The skew_x and skew_y parameters represent skew factors for the
99+
/// The `skew_x` and `skew_y` parameters represent skew factors for the
100100
/// horizontal and vertical directions, respectively.
101101
///
102102
/// This is commonly used to generate a faux oblique transform for
@@ -210,7 +210,7 @@ impl Affine {
210210
Affine::rotate(th) * self
211211
}
212212

213-
/// `self` followed by a rotation of `th` about `center.
213+
/// `self` followed by a rotation of `th` about `center`.
214214
///
215215
/// Equivalent to `Affine::rotate_about(th, center) * self`
216216
#[inline]

src/bezpath.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,11 +1157,11 @@ impl PathSeg {
11571157
a
11581158
}
11591159

1160-
/// Minimum distance between two PathSegs
1160+
/// Minimum distance between two [`PathSeg`]s.
11611161
///
11621162
/// Returns a tuple of the distance, the path time `t1` of the closest point
1163-
/// on the first PathSeg, and the path time `t2` of the closest point on the
1164-
/// second PathSeg.
1163+
/// on the first `PathSeg`, and the path time `t2` of the closest point on the
1164+
/// second `PathSeg`.
11651165
pub fn min_dist(&self, other: PathSeg, accuracy: f64) -> MinDistance {
11661166
let (distance, t1, t2) = crate::mindist::min_dist_param(
11671167
&self.as_vec2_vec(),
@@ -1648,7 +1648,7 @@ mod tests {
16481648
assert_eq!(expected_svg, reversed.to_svg());
16491649
}
16501650

1651-
/// https://github.com/fonttools/fonttools/blob/bf265ce49e0cae6f032420a4c80c31d8e16285b8/Tests/pens/reverseContourPen_test.py#L7
1651+
// https://github.com/fonttools/fonttools/blob/bf265ce49e0cae6f032420a4c80c31d8e16285b8/Tests/pens/reverseContourPen_test.py#L7
16521652
#[test]
16531653
fn test_reverse_lines() {
16541654
let mut path = BezPath::new();

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
7171
#![forbid(unsafe_code)]
7272
#![deny(missing_docs, clippy::trivially_copy_pass_by_ref)]
73-
#![warn(rustdoc::broken_intra_doc_links)]
73+
#![warn(clippy::doc_markdown, rustdoc::broken_intra_doc_links)]
7474
#![allow(
7575
clippy::unreadable_literal,
7676
clippy::many_single_char_names,

src/rounded_rect_radii.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ pub struct RoundedRectRadii {
3131
}
3232

3333
impl RoundedRectRadii {
34-
/// Create a new RoundedRectRadii. This function takes radius values for
35-
/// the four corners. The argument order is "top_left, top_right,
36-
/// bottom_right, bottom_left", or clockwise starting from top_left.
34+
/// Create a new `RoundedRectRadii`. This function takes radius values for
35+
/// the four corners. The argument order is `top_left`, `top_right`,
36+
/// `bottom_right`, `bottom_left`, or clockwise starting from `top_left`.
3737
pub const fn new(top_left: f64, top_right: f64, bottom_right: f64, bottom_left: f64) -> Self {
3838
RoundedRectRadii {
3939
top_left,
@@ -43,7 +43,7 @@ impl RoundedRectRadii {
4343
}
4444
}
4545

46-
/// Create a new RoundedRectRadii from a single radius. The `radius`
46+
/// Create a new `RoundedRectRadii` from a single radius. The `radius`
4747
/// argument will be set as the radius for all four corners.
4848
pub const fn from_single_radius(radius: f64) -> Self {
4949
RoundedRectRadii {

src/svg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ impl<'a> SvgLexer<'a> {
393393
impl SvgArc {
394394
/// Checks that arc is actually a straight line.
395395
///
396-
/// In this case, it can be replaced with a LineTo.
396+
/// In this case, it can be replaced with a `LineTo`.
397397
pub fn is_straight_line(&self) -> bool {
398398
self.radii.x.abs() <= 1e-5 || self.radii.y.abs() <= 1e-5 || self.from == self.to
399399
}

0 commit comments

Comments
 (0)