Skip to content

Commit

Permalink
migrate the project to 2021 edition
Browse files Browse the repository at this point in the history
  • Loading branch information
torao committed May 19, 2022
1 parent 80d6653 commit 9d253d8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "tinymt"
version = "1.0.6"
version = "1.0.7"
authors = ["Torao Takami <[email protected]>"]
edition = "2018"
edition = "2021"
repository = "https://github.com/torao/tinymt"
keywords = ["prng", "mersennetwister", "mt", "tinymt", "random"]
license = "MIT"
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ $ cargo +nightly fmt # or fmt -- --check

## History

* 2022-05-19 (v1.0.7) Migrate the project to 2021 edition.
* 2021-06-12 (v1.0.6) Upgrade `rand` to 0.8.

## Licenses
Expand Down
14 changes: 2 additions & 12 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use rand::{Error, RngCore, SeedableRng};
pub mod tinymt32;
pub mod tinymt64;

#[derive(Default)]
pub struct TinyMT64Seed(pub [u8; 8]);

impl From<u64> for TinyMT64Seed {
Expand All @@ -19,12 +20,6 @@ impl From<TinyMT64Seed> for u64 {
}
}

impl Default for TinyMT64Seed {
fn default() -> TinyMT64Seed {
TinyMT64Seed([0; 8])
}
}

impl AsMut<[u8]> for TinyMT64Seed {
fn as_mut(&mut self) -> &mut [u8] {
&mut self.0
Expand Down Expand Up @@ -84,6 +79,7 @@ impl RngCore for TinyMT64 {
}
}

#[derive(Default)]
pub struct TinyMT32Seed(pub [u8; 4]);

impl From<u32> for TinyMT32Seed {
Expand All @@ -98,12 +94,6 @@ impl From<TinyMT32Seed> for u32 {
}
}

impl Default for TinyMT32Seed {
fn default() -> TinyMT32Seed {
TinyMT32Seed([0; 4])
}
}

impl AsMut<[u8]> for TinyMT32Seed {
fn as_mut(&mut self) -> &mut [u8] {
&mut self.0
Expand Down

0 comments on commit 9d253d8

Please sign in to comment.