diff --git a/src/point.rs b/src/point.rs index 1291495..df5a299 100644 --- a/src/point.rs +++ b/src/point.rs @@ -80,12 +80,14 @@ impl Point3 { macro_rules! impl_point { ($PointN:ident { $($field:ident),+ }, $VectorN:ident, $n:expr) => { impl $PointN { - /// Construct a new vector, using the provided values. + /// Construct a new point, using the provided values. #[inline] pub fn new($($field: S),+) -> $PointN { $PointN { $($field: $field),+ } } + /// Perform the given operation on each field in the point, returning a new point + /// constructed from the operations. #[inline] pub fn map(self, mut f: F) -> $PointN where F: FnMut(S) -> U diff --git a/src/vector.rs b/src/vector.rs index 4f111ac..108792a 100644 --- a/src/vector.rs +++ b/src/vector.rs @@ -102,6 +102,8 @@ macro_rules! impl_vector { $VectorN { $($field: $field),+ } } + /// Perform the given operation on each field in the vector, returning a new point + /// constructed from the operations. #[inline] pub fn map(self, mut f: F) -> $VectorN where F: FnMut(S) -> U