Skip to content

Commit cf65202

Browse files
committed
Minor assorted cleanup
1 parent 972e099 commit cf65202

File tree

6 files changed

+14
-12
lines changed

6 files changed

+14
-12
lines changed

core/src/geom.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,8 +382,6 @@ impl<B> Plane3<B> {
382382
/// ```
383383
pub fn from_point_and_normal(pt: Point3<B>, n: Normal3) -> Self {
384384
let n = n.normalize();
385-
// For example, if pt = (0, 1, 0) and n = (0, 1, 0), d has to be 1
386-
// to satisfy the plane equation n_x + n_y + n_z = d
387385
let d = pt.to_vec().dot(&n.to());
388386
Plane::new(n.x(), n.y(), n.z(), d)
389387
}

core/src/math/point.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ mod tests {
586586
mod u32 {
587587
use super::*;
588588

589-
const pt2: fn(u32, u32) -> Point2u = super::super::pt2;
589+
const pt2: fn(u32, u32) -> Point2u = super::pt2;
590590

591591
#[test]
592592
fn vector_addition() {

core/src/math/space.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22
//!
33
//! TODO
44
5-
use core::fmt::{Debug, Formatter};
6-
use core::iter::zip;
7-
use core::marker::PhantomData;
5+
use core::{
6+
fmt::{Debug, Formatter},
7+
iter::zip,
8+
marker::PhantomData,
9+
};
810

9-
use crate::math::vary::{Iter, Vary, ZDiv};
11+
use super::vary::{Iter, Vary, ZDiv};
1012

1113
/// Trait for types representing elements of an affine space.
1214
///

core/src/math/spline.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ where
8888
/// stable than [`Self::eval`].
8989
pub fn fast_eval(&self, t: f32) -> T {
9090
let [p0, .., p3] = &self.0;
91-
step(t, p0, p3, |t| {
91+
92+
step(t, p0, p3, |_t| {
9293
// Add a linear combination of the three coefficients
9394
// to `p0` to get the result
9495
let [co3, co2, co1] = self.coefficients();

core/src/math/vec.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,7 @@ impl<Sp, const N: usize> Vector<[f32; N], Sp> {
215215
array::from_fn(|i| self[i].clamp(min[i], max[i])).into()
216216
}
217217

218-
/// Returns `true` if every component of `self` is finite,
219-
/// `false` otherwise.
218+
/// Returns `true` if every component of `self` is finite, `false` otherwise.
220219
///
221220
/// See [`f32::is_finite()`].
222221
pub fn is_finite(&self) -> bool {
@@ -231,14 +230,16 @@ where
231230
{
232231
/// Returns the length of `self`, squared.
233232
///
234-
/// This avoids taking the square root in cases it's not needed,
233+
/// This avoids taking the square root in cases where it's not needed,
235234
/// and works with scalars for which a square root is not defined.
236235
#[inline]
237236
pub fn len_sqr(&self) -> Sc {
238237
self.dot(self)
239238
}
240239

241240
/// Returns the dot product of `self` and `other`.
241+
///
242+
/// TODO docs
242243
#[inline]
243244
pub fn dot(&self, other: &Self) -> Sc {
244245
zip(&self.0, &other.0)

geom/src/io.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ where
134134
/// Parses an OBJ format mesh from an iterator.
135135
///
136136
/// # Errors
137-
/// Returns [`self::Error`] if OBJ parsing fails.
137+
/// Returns [`self::Error`][Error] if OBJ parsing fails.
138138
pub fn parse_obj<A>(src: impl IntoIterator<Item = u8>) -> Result<Builder<A>>
139139
where
140140
Builder<A>: TryFrom<Obj, Error = Error>,

0 commit comments

Comments
 (0)