From c1bb90ba331601fb0cfec4f77c6069c5467f3ddb Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Mon, 10 Jul 2023 14:55:58 +0700 Subject: [PATCH] docs: Small formatting improvements. --- src/bezpath.rs | 2 +- src/common.rs | 2 +- src/cubicbez.rs | 2 +- src/fit.rs | 2 +- src/offset.rs | 2 +- src/rounded_rect_radii.rs | 4 ++-- src/svg.rs | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/bezpath.rs b/src/bezpath.rs index ab2f03cd..19d3c082 100644 --- a/src/bezpath.rs +++ b/src/bezpath.rs @@ -1361,7 +1361,7 @@ impl Shape for PathSeg { /// The area under the curve. /// - /// We could just return 0, but this seems more useful. + /// We could just return `0`, but this seems more useful. fn area(&self) -> f64 { self.signed_area() } diff --git a/src/common.rs b/src/common.rs index 6f475f9b..697d274d 100644 --- a/src/common.rs +++ b/src/common.rs @@ -302,7 +302,7 @@ fn solve_quartic_inner(a: f64, b: f64, c: f64, d: f64, rescale: bool) -> Option< /// Factor a quartic into two quadratics. /// -/// Attempt to factor a quartic equation into two quadratic equations. Returns None either if there +/// Attempt to factor a quartic equation into two quadratic equations. Returns `None` either if there /// is overflow (in which case rescaling might succeed) or the factorization would result in /// complex coefficients. /// diff --git a/src/cubicbez.rs b/src/cubicbez.rs index 2100db6c..cd295ab3 100644 --- a/src/cubicbez.rs +++ b/src/cubicbez.rs @@ -161,7 +161,7 @@ impl CubicBez { /// Approximate a cubic with a single quadratic /// /// Returns a quadratic approximating the given cubic that maintains - /// endpoint tangents if that is within tolerance, or None otherwise. + /// endpoint tangents if that is within tolerance, or `None` otherwise. fn try_approx_quadratic(&self, accuracy: f64) -> Option { if let Some(q1) = Line::new(self.p0, self.p1).crossing_point(Line::new(self.p2, self.p3)) { let c1 = self.p0.lerp(q1, 2.0 / 3.0); diff --git a/src/fit.rs b/src/fit.rs index e090e6ce..30a6c573 100644 --- a/src/fit.rs +++ b/src/fit.rs @@ -281,7 +281,7 @@ impl CurveDist { /// Evaluate distance to a cubic approximation. /// - /// If distance exceeds stated accuracy, can return None. Note that + /// If distance exceeds stated accuracy, can return `None`. Note that /// `acc2` is the square of the target. /// /// Returns the squre of the error, which is intended to be a good diff --git a/src/offset.rs b/src/offset.rs index e6728142..29fd8166 100644 --- a/src/offset.rs +++ b/src/offset.rs @@ -67,7 +67,7 @@ impl CubicOffset { /// Create a new curve from Bézier segment and offset. /// /// This method should only be used if the Bézier is smooth. Use - /// [`new_regularized`]instead to deal with a wider range of inputs. + /// [`new_regularized`] instead to deal with a wider range of inputs. /// /// [`new_regularized`]: Self::new_regularized pub fn new(c: CubicBez, d: f64) -> Self { diff --git a/src/rounded_rect_radii.rs b/src/rounded_rect_radii.rs index 11ab402b..fd43a000 100644 --- a/src/rounded_rect_radii.rs +++ b/src/rounded_rect_radii.rs @@ -74,7 +74,7 @@ impl RoundedRectRadii { ) } - /// Returns true if all radius values are finite. + /// Returns `true` if all radius values are finite. pub fn is_finite(&self) -> bool { self.top_left.is_finite() && self.top_right.is_finite() @@ -82,7 +82,7 @@ impl RoundedRectRadii { && self.bottom_left.is_finite() } - /// Returns true if any corner radius value is NaN. + /// Returns `true` if any corner radius value is NaN. pub fn is_nan(&self) -> bool { self.top_left.is_nan() || self.top_right.is_nan() diff --git a/src/svg.rs b/src/svg.rs index 67c036fb..3b380fa8 100644 --- a/src/svg.rs +++ b/src/svg.rs @@ -33,7 +33,7 @@ pub struct SvgArc { } impl BezPath { - /// Create a BezPath with segments corresponding to the sequence of + /// Create a `BezPath` with segments corresponding to the sequence of /// `PathSeg`s pub fn from_path_segments(segments: impl Iterator) -> BezPath { let mut path_elements = Vec::new();