🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

fastrand

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fastrand - cargo Package Compare versions

Comparing version
2.0.1
to
2.0.2
+1
-1
.cargo_vcs_info.json
{
"git": {
"sha1": "387e3baead884a504d98e89bb4316db98f5c15ce"
"sha1": "a8f98b445d639ad473dbdfdee46dc2d8a792c7fe"
},
"path_in_vcs": ""
}

@@ -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);

@@ -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 = ["/.*"]

@@ -0,1 +1,5 @@

# Version 2.0.2
- Slight restructuring of the `with_seed` function. (#79)
# Version 2.0.1

@@ -2,0 +6,0 @@

# fastrand
[![Build](https://github.com/smol-rs/fastrand/workflows/Build%20and%20test/badge.svg)](
[![Build](https://github.com/smol-rs/fastrand/workflows/CI/badge.svg)](
https://github.com/smol-rs/fastrand/actions)

@@ -5,0 +5,0 @@ [![License](https://img.shields.io/badge/license-Apache--2.0_OR_MIT-blue.svg)](

@@ -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 @@ }

@@ -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