diff -Nru rust-rand-xorshift-0.1.1/Cargo.toml rust-rand-xorshift-0.2.0/Cargo.toml --- rust-rand-xorshift-0.1.1/Cargo.toml 1970-01-01 00:00:00.000000000 +0000 +++ rust-rand-xorshift-0.2.0/Cargo.toml 1970-01-01 00:00:00.000000000 +0000 @@ -3,7 +3,7 @@ # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies -# to registry (e.g. crates.io) dependencies +# to registry (e.g., crates.io) dependencies # # If you believe there's an error in this file please file an # issue against the rust-lang/cargo repository. If you're @@ -11,33 +11,30 @@ # will likely look very different (and much more reasonable) [package] +edition = "2018" name = "rand_xorshift" -version = "0.1.1" +version = "0.2.0" authors = ["The Rand Project Developers", "The Rust Project Developers"] description = "Xorshift random number generator\n" homepage = "https://crates.io/crates/rand_xorshift" -documentation = "https://rust-random.github.io/rand/rand_xorshift" +documentation = "https://rust-random.github.io/rand/rand_xorshift/" readme = "README.md" keywords = ["random", "rng", "xorshift"] categories = ["algorithms", "no-std"] license = "MIT/Apache-2.0" repository = "https://github.com/rust-random/rand" [dependencies.rand_core] -version = ">=0.2, <0.4" -default-features = false +version = "0.5" [dependencies.serde] version = "1" -optional = true - -[dependencies.serde_derive] -version = "^1.0.38" +features = ["derive"] optional = true [dev-dependencies.bincode] version = "1" [features] -serde1 = ["serde", "serde_derive"] +serde1 = ["serde"] [badges.appveyor] repository = "rust-random/rand" diff -Nru rust-rand-xorshift-0.1.1/Cargo.toml.orig rust-rand-xorshift-0.2.0/Cargo.toml.orig --- rust-rand-xorshift-0.1.1/Cargo.toml.orig 2019-01-03 14:33:59.000000000 +0000 +++ rust-rand-xorshift-0.2.0/Cargo.toml.orig 2019-06-11 15:26:28.000000000 +0000 @@ -1,29 +1,29 @@ [package] name = "rand_xorshift" -version = "0.1.1" +version = "0.2.0" authors = ["The Rand Project Developers", "The Rust Project Developers"] license = "MIT/Apache-2.0" readme = "README.md" repository = "https://github.com/rust-random/rand" -documentation = "https://rust-random.github.io/rand/rand_xorshift" +documentation = "https://rust-random.github.io/rand/rand_xorshift/" homepage = "https://crates.io/crates/rand_xorshift" description = """ Xorshift random number generator """ keywords = ["random", "rng", "xorshift"] categories = ["algorithms", "no-std"] +edition = "2018" [badges] travis-ci = { repository = "rust-random/rand" } appveyor = { repository = "rust-random/rand" } [features] -serde1 = ["serde", "serde_derive"] +serde1 = ["serde"] [dependencies] -rand_core = { path = "../rand_core", version = ">=0.2, <0.4", default-features=false } -serde = { version = "1", optional = true } -serde_derive = { version = "^1.0.38", optional = true } +rand_core = { path = "../rand_core", version = "0.5" } +serde = { version = "1", features = ["derive"], optional = true } [dev-dependencies] # This is for testing serde, unfortunately we can't specify feature-gated dev diff -Nru rust-rand-xorshift-0.1.1/.cargo_vcs_info.json rust-rand-xorshift-0.2.0/.cargo_vcs_info.json --- rust-rand-xorshift-0.1.1/.cargo_vcs_info.json 1970-01-01 00:00:00.000000000 +0000 +++ rust-rand-xorshift-0.2.0/.cargo_vcs_info.json 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +1,5 @@ { "git": { - "sha1": "3001e91bca7858facf0fb8f91275a6ff8264da9f" + "sha1": "5610bdae3acdb0324f5636bb3e4a21e6324ead72" } } diff -Nru rust-rand-xorshift-0.1.1/CHANGELOG.md rust-rand-xorshift-0.2.0/CHANGELOG.md --- rust-rand-xorshift-0.1.1/CHANGELOG.md 2019-01-03 14:33:50.000000000 +0000 +++ rust-rand-xorshift-0.2.0/CHANGELOG.md 2019-06-11 15:26:28.000000000 +0000 @@ -4,6 +4,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.2.0] - 2019-06-12 +- Bump minor crate version since rand_core bump is a breaking change +- Switch to Edition 2018 + +## [0.1.2] - 2019-06-06 - yanked +- Bump `rand_core` version +- Make XorShiftRng::from_rng portable by enforcing Endianness (#815) + ## [0.1.1] - 2019-01-04 - Reorganise code and tests; tweak doc diff -Nru rust-rand-xorshift-0.1.1/debian/cargo-checksum.json rust-rand-xorshift-0.2.0/debian/cargo-checksum.json --- rust-rand-xorshift-0.1.1/debian/cargo-checksum.json 2019-01-05 19:05:38.000000000 +0000 +++ rust-rand-xorshift-0.2.0/debian/cargo-checksum.json 2019-08-29 14:50:47.000000000 +0000 @@ -1 +1 @@ -{"package":"cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c","files":{}} +{"package":"77d416b86801d23dde1aa643023b775c3a462efc0ed96443add11546cdf1dca8","files":{}} diff -Nru rust-rand-xorshift-0.1.1/debian/changelog rust-rand-xorshift-0.2.0/debian/changelog --- rust-rand-xorshift-0.1.1/debian/changelog 2019-01-05 19:05:38.000000000 +0000 +++ rust-rand-xorshift-0.2.0/debian/changelog 2019-08-29 14:50:47.000000000 +0000 @@ -1,3 +1,10 @@ +rust-rand-xorshift (0.2.0-1) unstable; urgency=medium + + * Team upload. + * Package rand_xorshift 0.2.0 from crates.io using debcargo 2.4.0 + + -- Ximin Luo Thu, 29 Aug 2019 07:50:47 -0700 + rust-rand-xorshift (0.1.1-1) unstable; urgency=medium * Package rand_xorshift 0.1.1 from crates.io using debcargo 2.2.9 diff -Nru rust-rand-xorshift-0.1.1/debian/control rust-rand-xorshift-0.2.0/debian/control --- rust-rand-xorshift-0.1.1/debian/control 2019-01-05 19:05:38.000000000 +0000 +++ rust-rand-xorshift-0.2.0/debian/control 2019-08-29 14:50:47.000000000 +0000 @@ -2,11 +2,11 @@ Section: rust Priority: optional Build-Depends: debhelper (>= 11), - dh-cargo (>= 10), + dh-cargo (>= 18), cargo:native , rustc:native , libstd-rust-dev , - librust-rand-core-0.3-dev | librust-rand-core-0.2-dev + librust-rand-core-0.5+default-dev Maintainer: Debian Rust Maintainers Uploaders: Wolfgang Silbermayr @@ -21,19 +21,17 @@ Multi-Arch: same Depends: ${misc:Depends}, - librust-rand-core-0.3-dev | librust-rand-core-0.2-dev + librust-rand-core-0.5+default-dev Suggests: - librust-rand-xorshift+serde-dev (= ${binary:Version}), - librust-rand-xorshift+serde1-dev (= ${binary:Version}), - librust-rand-xorshift+serde-derive-dev (= ${binary:Version}) + librust-rand-xorshift+serde-dev (= ${binary:Version}) Provides: librust-rand-xorshift+default-dev (= ${binary:Version}), librust-rand-xorshift-0-dev (= ${binary:Version}), librust-rand-xorshift-0+default-dev (= ${binary:Version}), - librust-rand-xorshift-0.1-dev (= ${binary:Version}), - librust-rand-xorshift-0.1+default-dev (= ${binary:Version}), - librust-rand-xorshift-0.1.1-dev (= ${binary:Version}), - librust-rand-xorshift-0.1.1+default-dev (= ${binary:Version}) + librust-rand-xorshift-0.2-dev (= ${binary:Version}), + librust-rand-xorshift-0.2+default-dev (= ${binary:Version}), + librust-rand-xorshift-0.2.0-dev (= ${binary:Version}), + librust-rand-xorshift-0.2.0+default-dev (= ${binary:Version}) Description: Xorshift random number generator - Rust source code This package contains the source for the Rust rand_xorshift crate, packaged by debcargo for use with cargo and dh-cargo. @@ -44,42 +42,18 @@ Depends: ${misc:Depends}, librust-rand-xorshift-dev (= ${binary:Version}), - librust-serde-1+default-dev -Provides: - librust-rand-xorshift-0+serde-dev (= ${binary:Version}), - librust-rand-xorshift-0.1+serde-dev (= ${binary:Version}), - librust-rand-xorshift-0.1.1+serde-dev (= ${binary:Version}) -Description: Xorshift random number generator - feature "serde" - This metapackage enables feature serde for the Rust rand_xorshift crate, by - pulling in any additional dependencies needed by that feature. - -Package: librust-rand-xorshift+serde1-dev -Architecture: any -Multi-Arch: same -Depends: - ${misc:Depends}, - librust-rand-xorshift-dev (= ${binary:Version}), librust-serde-1+default-dev, - librust-serde-derive-1+default-dev (>= 1.0.38-~~) + librust-serde-1+derive-dev Provides: + librust-rand-xorshift+serde1-dev (= ${binary:Version}), + librust-rand-xorshift-0+serde-dev (= ${binary:Version}), librust-rand-xorshift-0+serde1-dev (= ${binary:Version}), - librust-rand-xorshift-0.1+serde1-dev (= ${binary:Version}), - librust-rand-xorshift-0.1.1+serde1-dev (= ${binary:Version}) -Description: Xorshift random number generator - feature "serde1" - This metapackage enables feature serde1 for the Rust rand_xorshift crate, by + librust-rand-xorshift-0.2+serde-dev (= ${binary:Version}), + librust-rand-xorshift-0.2+serde1-dev (= ${binary:Version}), + librust-rand-xorshift-0.2.0+serde-dev (= ${binary:Version}), + librust-rand-xorshift-0.2.0+serde1-dev (= ${binary:Version}) +Description: Xorshift random number generator - feature "serde" and 1 more + This metapackage enables feature "serde" for the Rust rand_xorshift crate, by pulling in any additional dependencies needed by that feature. - -Package: librust-rand-xorshift+serde-derive-dev -Architecture: any -Multi-Arch: same -Depends: - ${misc:Depends}, - librust-rand-xorshift-dev (= ${binary:Version}), - librust-serde-derive-1+default-dev (>= 1.0.38-~~) -Provides: - librust-rand-xorshift-0+serde-derive-dev (= ${binary:Version}), - librust-rand-xorshift-0.1+serde-derive-dev (= ${binary:Version}), - librust-rand-xorshift-0.1.1+serde-derive-dev (= ${binary:Version}) -Description: Xorshift random number generator - feature "serde_derive" - This metapackage enables feature serde_derive for the Rust rand_xorshift crate, - by pulling in any additional dependencies needed by that feature. + . + Additionally, this package also provides the "serde1" feature. diff -Nru rust-rand-xorshift-0.1.1/debian/tests/control rust-rand-xorshift-0.2.0/debian/tests/control --- rust-rand-xorshift-0.1.1/debian/tests/control 1970-01-01 00:00:00.000000000 +0000 +++ rust-rand-xorshift-0.2.0/debian/tests/control 2019-08-29 14:50:47.000000000 +0000 @@ -0,0 +1,11 @@ +Test-Command: /usr/share/cargo/bin/cargo-auto-test rand_xorshift 0.2.0 --all-targets --all-features +Depends: dh-cargo (>= 18), librust-bincode-1+default-dev, @ +Restrictions: allow-stderr, skip-not-installable + +Test-Command: /usr/share/cargo/bin/cargo-auto-test rand_xorshift 0.2.0 --all-targets --no-default-features +Depends: dh-cargo (>= 18), librust-bincode-1+default-dev, librust-rand-xorshift-dev +Restrictions: allow-stderr, skip-not-installable + +Test-Command: /usr/share/cargo/bin/cargo-auto-test rand_xorshift 0.2.0 --all-targets --features serde +Depends: dh-cargo (>= 18), librust-bincode-1+default-dev, librust-rand-xorshift+serde-dev +Restrictions: allow-stderr, skip-not-installable diff -Nru rust-rand-xorshift-0.1.1/README.md rust-rand-xorshift-0.2.0/README.md --- rust-rand-xorshift-0.1.1/README.md 2018-11-26 10:56:07.000000000 +0000 +++ rust-rand-xorshift-0.2.0/README.md 2019-06-11 09:07:48.000000000 +0000 @@ -6,7 +6,7 @@ [![Book](https://img.shields.io/badge/book-master-yellow.svg)](https://rust-random.github.io/book/) [![API](https://img.shields.io/badge/api-master-yellow.svg)](https://rust-random.github.io/rand/rand_xorshift) [![API](https://docs.rs/rand_xorshift/badge.svg)](https://docs.rs/rand_xorshift) -[![Minimum rustc version](https://img.shields.io/badge/rustc-1.22+-lightgray.svg)](https://github.com/rust-random/rand#rust-version-requirements) +[![Minimum rustc version](https://img.shields.io/badge/rustc-1.32+-lightgray.svg)](https://github.com/rust-random/rand#rust-version-requirements) Implements the Xorshift random number generator. @@ -22,7 +22,7 @@ - [API documentation (master)](https://rust-random.github.io/rand/rand_xorshift) - [API documentation (docs.rs)](https://docs.rs/rand_xorshift) -- [Changelog](CHANGELOG.md) +- [Changelog](https://github.com/rust-random/rand/blob/master/rand_xorshift/CHANGELOG.md) [rand]: https://crates.io/crates/rand diff -Nru rust-rand-xorshift-0.1.1/src/lib.rs rust-rand-xorshift-0.2.0/src/lib.rs --- rust-rand-xorshift-0.1.1/src/lib.rs 2018-11-26 10:56:07.000000000 +0000 +++ rust-rand-xorshift-0.2.0/src/lib.rs 2019-06-12 08:53:27.000000000 +0000 @@ -17,14 +17,10 @@ #![no_std] -extern crate rand_core; - -#[cfg(feature="serde1")] extern crate serde; -#[cfg(feature="serde1")] #[macro_use] extern crate serde_derive; - use core::num::Wrapping as w; use core::{fmt, slice}; use rand_core::{RngCore, SeedableRng, Error, impls, le}; +#[cfg(feature="serde1")] use serde::{Serialize, Deserialize}; /// An Xorshift random number generator. /// @@ -110,6 +106,10 @@ let slice = slice::from_raw_parts_mut(ptr, 4 * 4); rng.try_fill_bytes(slice)?; } + for v in seed_u32.iter_mut() { + // enforce LE for consistency across platforms + *v = v.to_le(); + } if !seed_u32.iter().all(|&x| x == 0) { break; } } diff -Nru rust-rand-xorshift-0.1.1/tests/mod.rs rust-rand-xorshift-0.2.0/tests/mod.rs --- rust-rand-xorshift-0.1.1/tests/mod.rs 2018-11-22 17:41:16.000000000 +0000 +++ rust-rand-xorshift-0.2.0/tests/mod.rs 2019-06-12 08:53:22.000000000 +0000 @@ -1,7 +1,3 @@ -extern crate rand_core; -extern crate rand_xorshift; -#[cfg(all(feature="serde1", test))] extern crate bincode; - use rand_core::{RngCore, SeedableRng}; use rand_xorshift::XorShiftRng; @@ -12,9 +8,10 @@ let mut rng1 = XorShiftRng::from_seed(seed); assert_eq!(rng1.next_u64(), 4325440999699518727); - let _rng2 = XorShiftRng::from_rng(rng1).unwrap(); - // Note: we cannot test the state of _rng2 because from_rng does not - // fix Endianness. This is allowed in the trait specification. + let mut rng2 = XorShiftRng::from_rng(&mut rng1).unwrap(); + // Yes, this makes rng2 a clone of rng1! + assert_eq!(rng1.next_u64(), 15614385950550801700); + assert_eq!(rng2.next_u64(), 15614385950550801700); } #[test]