do it like this

This commit is contained in:
Quaternions 2024-08-23 16:31:25 -07:00
parent 01de555888
commit 75ca27f232
3 changed files with 13 additions and 9 deletions

View File

@ -1,5 +1,9 @@
mod macros; mod macros;
pub mod vector; mod vector;
pub use vector::Vector2;
pub use vector::Vector3;
pub use vector::Vector4;
#[cfg(test)] #[cfg(test)]
mod tests; mod tests;

View File

@ -11,7 +11,7 @@ macro_rules! impl_vector {
/// # Example /// # Example
/// ///
/// ``` /// ```
/// use fixed_wide_vectors::vector::Vector2; /// use fixed_wide_vectors::Vector2;
/// ///
/// let vec2 = Vector2::new(0, 0); /// let vec2 = Vector2::new(0, 0);
/// ///
@ -30,7 +30,7 @@ macro_rules! impl_vector {
/// # Example /// # Example
/// ///
/// ``` /// ```
/// use fixed_wide_vectors::vector::Vector2; /// use fixed_wide_vectors::Vector2;
/// ///
/// let vec2 = Vector2::new(0, 0); /// let vec2 = Vector2::new(0, 0);
/// let array = vec2.to_array(); /// let array = vec2.to_array();
@ -47,7 +47,7 @@ macro_rules! impl_vector {
/// # Example /// # Example
/// ///
/// ``` /// ```
/// use fixed_wide_vectors::vector::Vector2; /// use fixed_wide_vectors::Vector2;
/// ///
/// let vec2 = Vector2::new(0, 0); /// let vec2 = Vector2::new(0, 0);
/// let tuple = vec2.to_tuple(); /// let tuple = vec2.to_tuple();
@ -64,7 +64,7 @@ macro_rules! impl_vector {
/// # Example /// # Example
/// ///
/// ``` /// ```
/// use fixed_wide_vectors::vector::Vector2; /// use fixed_wide_vectors::Vector2;
/// ///
/// let vec2 = Vector2::new(1, 2) /// let vec2 = Vector2::new(1, 2)
/// .map(|i| i * 2); /// .map(|i| i * 2);
@ -88,7 +88,7 @@ macro_rules! impl_vector {
/// # Example /// # Example
/// ///
/// ``` /// ```
/// use fixed_wide_vectors::vector::Vector2; /// use fixed_wide_vectors::Vector2;
/// ///
/// let vec2 = Vector2::from_value(0); /// let vec2 = Vector2::from_value(0);
/// ///

View File

@ -5,7 +5,7 @@
/// # Example /// # Example
/// ///
/// ``` /// ```
/// use fixed_wide_vectors::vector::Vector2; /// use fixed_wide_vectors::Vector2;
/// ///
/// let mut vec2 = Vector2::new(1, 2); /// let mut vec2 = Vector2::new(1, 2);
/// vec2 += Vector2::new(1, 2); /// vec2 += Vector2::new(1, 2);
@ -24,7 +24,7 @@ pub struct Vector2<T> {
/// # Example /// # Example
/// ///
/// ``` /// ```
/// use fixed_wide_vectors::vector::Vector3; /// use fixed_wide_vectors::Vector3;
/// ///
/// let mut vec3 = Vector3::new(1, 2, 3); /// let mut vec3 = Vector3::new(1, 2, 3);
/// vec3 += Vector3::new(1, 2, 3); /// vec3 += Vector3::new(1, 2, 3);
@ -45,7 +45,7 @@ pub struct Vector3<T> {
/// # Example /// # Example
/// ///
/// ``` /// ```
/// use fixed_wide_vectors::vector::Vector4; /// use fixed_wide_vectors::Vector4;
/// ///
/// let mut vec4 = Vector4::new(1, 2, 3, 4); /// let mut vec4 = Vector4::new(1, 2, 3, 4);
/// vec4 += Vector4::new(1, 2, 3, 4); /// vec4 += Vector4::new(1, 2, 3, 4);