diff --git a/CHANGELOG.md b/CHANGELOG.md index a62287e..d0f9466 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ # Change Log -### v0.5.9 (XX-XX-2022) +### v0.5.10 (01-01-2024) +- implement `Default` + +### v0.5.9 (02-02-2022) - implement `AsMut` ### v0.5.8 (22-10-2021) diff --git a/Cargo.toml b/Cargo.toml index 6885de1..6b245f3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "mint" -version = "0.5.9" +version = "0.5.10" +#TODO: update to 2021 when MSRV allows edition = "2018" authors = [ "Benjamin Saunders ", @@ -22,4 +23,4 @@ keywords = ["math"] serde = { version = "1.0", optional = true, default-features = false } [dev-dependencies] -serde_json = "1.0" +serde_json = "=1.0.100" # later versions use rust-2021 diff --git a/src/lib.rs b/src/lib.rs index e9aa5bd..44395f6 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -7,8 +7,6 @@ Designed to serve as an interoperability standard between libraries. #![no_std] #![deny( missing_docs, - rust_2018_compatibility, - rust_2018_idioms, future_incompatible, nonstandard_style, unused, diff --git a/src/matrix.rs b/src/matrix.rs index 31375a6..f95e007 100644 --- a/src/matrix.rs +++ b/src/matrix.rs @@ -3,7 +3,7 @@ use crate::IntoMint; macro_rules! matrix { ($name:ident : $vec:ident[ $($field:ident[$($sub:ident),*] = $index:expr),* ] = ($inner:expr, $outer:expr)) => { - #[derive(Clone, Copy, Debug, Hash, PartialEq, PartialOrd, Eq, Ord)] + #[derive(Clone, Copy, Debug, Default, Hash, PartialEq, PartialOrd, Eq, Ord)] #[repr(C)] #[allow(missing_docs)] //TODO: actually have docs pub struct $name { diff --git a/src/rotation.rs b/src/rotation.rs index 154da9e..e2e9834 100644 --- a/src/rotation.rs +++ b/src/rotation.rs @@ -5,7 +5,7 @@ use core::marker::PhantomData; /// Standard quaternion represented by the scalar and vector parts. /// Useful for representing rotation in 3D space. /// Corresponds to a right-handed rotation matrix. -#[derive(Clone, Copy, Debug, Hash, PartialEq, PartialOrd, Eq, Ord)] +#[derive(Clone, Copy, Debug, Default, Hash, PartialEq, PartialOrd, Eq, Ord)] #[repr(C)] pub struct Quaternion { /// Vector part of a quaternion. @@ -111,6 +111,17 @@ pub enum ExtraZXZ {} #[derive(Clone, Copy, Debug, Hash, PartialEq, PartialOrd, Eq, Ord)] pub enum ExtraZYX {} +impl Default for EulerAngles { + fn default() -> Self { + Self { + a: T::default(), + b: T::default(), + c: T::default(), + marker: PhantomData, + } + } +} + impl From<[T; 3]> for EulerAngles { fn from([a, b, c]: [T; 3]) -> Self { EulerAngles { diff --git a/src/vector.rs b/src/vector.rs index ebda799..3b9e16d 100644 --- a/src/vector.rs +++ b/src/vector.rs @@ -2,7 +2,7 @@ use crate::IntoMint; macro_rules! vec { ($name:ident [ $($field:ident),* ] = $fixed:ty) => { - #[derive(Clone, Copy, Debug, Hash, PartialEq, PartialOrd, Eq, Ord)] + #[derive(Clone, Copy, Debug, Default, Hash, PartialEq, PartialOrd, Eq, Ord)] #[repr(C)] #[allow(missing_docs)] //TODO: actually have docs pub struct $name {