-
Notifications
You must be signed in to change notification settings - Fork 430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move XorShiftRng
to its own crate
#557
Changes from all commits
a253a80
a385938
2cf9acb
9b069fe
2847c8a
ecc6e66
a3ac8d3
2a658d9
dac6227
ecd1867
e7b17dd
29a9d1d
cb275bc
d2e7378
b846c30
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,14 +18,17 @@ | |
#![deny(missing_debug_implementations)] | ||
#![doc(test(attr(allow(unused_variables), deny(warnings))))] | ||
|
||
#![no_std] | ||
#![cfg_attr(not(all(feature="serde1", test)), no_std)] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense, but is surprising There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The only alternative I can see would be making our tests work with |
||
|
||
extern crate rand_core; | ||
|
||
#[cfg(test)] #[cfg(feature="serde1")] extern crate bincode; | ||
#[cfg(feature="serde1")] extern crate serde; | ||
#[cfg(feature="serde1")] #[macro_use] extern crate serde_derive; | ||
|
||
// To test serialization we need bincode and the standard library | ||
#[cfg(all(feature="serde1", test))] extern crate bincode; | ||
#[cfg(all(feature="serde1", test))] extern crate std as core; | ||
|
||
pub mod isaac; | ||
pub mod isaac64; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Changelog | ||
All notable changes to this project will be documented in this file. | ||
|
||
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.1.0] - 2018-07-16 | ||
- Initial release |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
[package] | ||
name = "rand_xorshift" | ||
version = "0.1.0" # NB: When modifying, also modify html_root_url in lib.rs | ||
authors = ["The Rust Project Developers"] | ||
license = "MIT/Apache-2.0" | ||
readme = "README.md" | ||
repository = "https://github.com/rust-lang-nursery/rand" | ||
documentation = "https://docs.rs/rand_isaac" | ||
homepage = "https://crates.io/crates/rand_isaac" | ||
description = """ | ||
Xorshift random number generator | ||
""" | ||
keywords = ["random", "rng", "xorshift"] | ||
categories = ["algorithms", "no-std"] | ||
|
||
[badges] | ||
travis-ci = { repository = "rust-lang-nursery/rand" } | ||
appveyor = { repository = "alexcrichton/rand" } | ||
|
||
[features] | ||
serde1 = ["serde", "serde_derive"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as for |
||
|
||
[dependencies] | ||
rand_core = { path = "../rand_core", version = "0.2", default-features=false } | ||
serde = { version = "1", optional = true } | ||
serde_derive = { version = "^1.0.38", optional = true } | ||
|
||
[dev-dependencies] | ||
# This is for testing serde, unfortunately we can't specify feature-gated dev | ||
# deps yet, see: https://github.com/rust-lang/cargo/issues/1596 | ||
bincode = "1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feature
serde1
implicitly impliesstd
— should probably be documented with a comment here and in the READMEThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean? We don't require
std
for theserde1
feature, and Serde works withoutstd
. We only needstd
for the tests.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, sorry. I mis-understood the double-negative conditional
no_std
attribute.