Skip to content

Commit

Permalink
Implement Default, bump version to 0.5.10
Browse files Browse the repository at this point in the history
  • Loading branch information
kvark committed Dec 24, 2023
1 parent 8ea6a9f commit d4cc21f
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 8 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Change Log

### v0.5.9 (XX-XX-2022)
### v0.5.10 (23-12-2023)
- implement `Default`
- update to Rust 2021 edition

### v0.5.9 (02-02-2022)
- implement `AsMut<array>`

### v0.5.8 (22-10-2021)
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "mint"
version = "0.5.9"
edition = "2018"
version = "0.5.10"
edition = "2021"
authors = [
"Benjamin Saunders <[email protected]>",
"Dzmitry Malyshau <[email protected]>",
Expand Down
2 changes: 0 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/matrix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T> {
Expand Down
13 changes: 12 additions & 1 deletion src/rotation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T> {
/// Vector part of a quaternion.
Expand Down Expand Up @@ -111,6 +111,17 @@ pub enum ExtraZXZ {}
#[derive(Clone, Copy, Debug, Hash, PartialEq, PartialOrd, Eq, Ord)]
pub enum ExtraZYX {}

impl<T: Default, B> Default for EulerAngles<T, B> {
fn default() -> Self {
Self {
a: T::default(),
b: T::default(),
c: T::default(),
marker: PhantomData,
}
}
}

impl<T, B> From<[T; 3]> for EulerAngles<T, B> {
fn from([a, b, c]: [T; 3]) -> Self {
EulerAngles {
Expand Down
2 changes: 1 addition & 1 deletion src/vector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T> {
Expand Down

0 comments on commit d4cc21f

Please sign in to comment.