| { | ||
| "git": { | ||
| "sha1": "387e3baead884a504d98e89bb4316db98f5c15ce" | ||
| "sha1": "a8f98b445d639ad473dbdfdee46dc2d8a792c7fe" | ||
| }, | ||
| "path_in_vcs": "" | ||
| } |
+1
-1
@@ -81,3 +81,3 @@ #![feature(test)] | ||
| b.iter(|| { | ||
| // Pick a size that isn't divisble by 8. | ||
| // Pick a size that isn't divisible by 8. | ||
| let mut bytes = [0u8; 367]; | ||
@@ -84,0 +84,0 @@ rng.fill(&mut bytes); |
+1
-1
@@ -16,3 +16,3 @@ # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO | ||
| name = "fastrand" | ||
| version = "2.0.1" | ||
| version = "2.0.2" | ||
| authors = ["Stjepan Glavina <stjepang@gmail.com>"] | ||
@@ -19,0 +19,0 @@ exclude = ["/.*"] |
+4
-0
@@ -0,1 +1,5 @@ | ||
| # Version 2.0.2 | ||
| - Slight restructuring of the `with_seed` function. (#79) | ||
| # Version 2.0.1 | ||
@@ -2,0 +6,0 @@ |
+1
-1
| # fastrand | ||
| []( | ||
| []( | ||
| https://github.com/smol-rs/fastrand/actions) | ||
@@ -5,0 +5,0 @@ []( |
@@ -7,2 +7,3 @@ //! A global, thread-local random number generator. | ||
| use std::ops::RangeBounds; | ||
| use std::vec::Vec; | ||
@@ -30,3 +31,3 @@ // Chosen by fair roll of the dice. | ||
| thread_local! { | ||
| std::thread_local! { | ||
| static RNG: Cell<Rng> = Cell::new(Rng(random_seed().unwrap_or(DEFAULT_RNG_SEED))); | ||
@@ -33,0 +34,0 @@ } |
+4
-5
@@ -101,3 +101,3 @@ //! A simple and fast random number generator. | ||
| #![cfg_attr(not(feature = "std"), no_std)] | ||
| #![no_std] | ||
| #![cfg_attr(docsrs, feature(doc_cfg))] | ||
@@ -115,2 +115,4 @@ #![forbid(unsafe_code)] | ||
| extern crate alloc; | ||
| #[cfg(feature = "std")] | ||
| extern crate std; | ||
@@ -289,6 +291,3 @@ use core::convert::{TryFrom, TryInto}; | ||
| pub fn with_seed(seed: u64) -> Self { | ||
| let mut rng = Rng(0); | ||
| rng.seed(seed); | ||
| rng | ||
| Rng(seed) | ||
| } | ||
@@ -295,0 +294,0 @@ |
Sorry, the diff of this file is not supported yet