Skip to content

Commit 717f785

Browse files
authored
Merge pull request #327 from pitdicker/rand_core_rename
Rename rand-core to rand_core
2 parents 57163f6 + d37d8d1 commit 717f785

13 files changed

+28
-30
lines changed

CHANGELOG.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7-
A [separate changelog is kept for rand-core](rand-core/CHANGELOG.md).
7+
A [separate changelog is kept for rand_core](rand_core/CHANGELOG.md).
88

99
You may also find the [Update Guide](UPDATING.md) useful.
1010

@@ -13,7 +13,7 @@ You may also find the [Update Guide](UPDATING.md) useful.
1313

1414
### Crate features and organisation
1515
- Minimum Rust version update: 1.22.0. (#239)
16-
- Create a seperate `rand-core` crate. (#288)
16+
- Create a seperate `rand_core` crate. (#288)
1717
- Deprecate `rand_derive`. (#256)
1818
- Add `log` feature. Logging is now available in `JitterRng`, `OsRng`, `EntropyRng` and `ReseedingRng`. (#246)
1919
- Add `serde-1` feature for some PRNGs. (#189)
@@ -29,9 +29,9 @@ You may also find the [Update Guide](UPDATING.md) useful.
2929
- Deprecate `Rng::gen_iter`. (#286)
3030
- Deprecate `Rng::gen_ascii_chars`. (#279)
3131

32-
### `rand-core` crate
32+
### `rand_core` crate
3333
(changes included here because they greatly influence the Rand crate)
34-
- `RngCore` and `SeedableRng` are now part of `rand-core`. (#288)
34+
- `RngCore` and `SeedableRng` are now part of `rand_core`. (#288)
3535
- Add modules to help implementing RNGs `impl` and `le`. (#209, #228)
3636
- Add `Error` and `ErrorKind`. (#225)
3737
- Add `CryptoRng` marker trait. (#273)

Cargo.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ categories = ["algorithms"]
1717
default = ["std"]
1818
nightly = ["i128_support"] # enables all features requiring nightly rust
1919

20-
std = ["rand-core/std", "winapi", "libc"] # default feature; without this rand uses libcore
21-
alloc = ["rand-core/alloc"] # enables Vec and Box support without std
20+
std = ["rand_core/std", "winapi", "libc"] # default feature; without this rand uses libcore
21+
alloc = ["rand_core/alloc"] # enables Vec and Box support without std
2222

2323
i128_support = [] # enables i128 and u128 support
2424

@@ -32,15 +32,15 @@ libc = { version = "0.2", optional = true }
3232
winapi = { version = "0.3", features = ["minwindef", "ntsecapi", "profileapi", "winnt"], optional = true }
3333

3434
[dependencies]
35-
rand-core = { path = 'rand-core', default-features = false }
35+
rand_core = { path = 'rand_core', default-features = false }
3636

3737
log = { version = "0.4", optional = true }
3838

3939
serde = {version="1",optional=true}
4040
serde_derive = {version="1", optional=true}
4141

4242
[workspace]
43-
members = ["rand-core"]
43+
members = ["rand_core"]
4444

4545
[dev-dependencies]
4646
# This is for testing serde, unfortunately

UPDATING.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ This release also contains many optimisations, which are not detailed below.
1313

1414
### Crates
1515

16-
We have a new crate: `rand-core`! This crate houses some important traits,
16+
We have a new crate: `rand_core`! This crate houses some important traits,
1717
`RngCore`, `BlockRngCore`, `SeedableRng` and `CryptoRng`, the error types, as
1818
well as two modules with helpers for implementations: `le` and `impls`. It is
19-
recommended that implementations of generators use the `rand-core` trait while
20-
other users use only the `rand` crate, which re-exports most parts of `rand-core`.
19+
recommended that implementations of generators use the `rand_core` trait while
20+
other users use only the `rand` crate, which re-exports most parts of `rand_core`.
2121

2222
The `rand_derive` crate has been deprecated due to very low usage and
2323
deprecation of `Rand`.
@@ -36,7 +36,7 @@ Several new Cargo feature flags have been added:
3636
by generators) and a "front end" `Rng` implementing all the convenient extension
3737
methods.
3838

39-
Implementations of generators must `impl RngCore` instead. Usage of `rand-core`
39+
Implementations of generators must `impl RngCore` instead. Usage of `rand_core`
4040
for implementations is encouraged; the `rand_core::{le, impls}` modules may
4141
prove useful.
4242

@@ -109,7 +109,7 @@ Endianness. Helper functions are available in `rand_core::le` to read `u32` and
109109

110110
#### Block-based PRNGs
111111

112-
rand-core has a new helper trait, `BlockRngCore`, and implementation,
112+
rand_core has a new helper trait, `BlockRngCore`, and implementation,
113113
`BlockRng`. These are for use by generators which generate a block of random
114114
data at a time instead of word-sized values. Using this trait and implementation
115115
has two advantages: optimised `RngCore` methods are provided, and the PRNG can

rand-core/CHANGELOG.md renamed to rand_core/CHANGELOG.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77

88
## [0.1.0] - Unreleased
9-
10-
### `rand-core` crate
119
(Split out of the Rand crate, changes here are relative to rand 0.4.2)
12-
- `RngCore` and `SeedableRng` are now part of `rand-core`. (#288)
10+
- `RngCore` and `SeedableRng` are now part of `rand_core`. (#288)
1311
- Add modules to help implementing RNGs `impl` and `le`. (#209, #228)
1412
- Add `Error` and `ErrorKind`. (#225)
1513
- Add `CryptoRng` marker trait. (#273)
@@ -19,5 +17,5 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1917
- Remove default implementations for `RngCore::next_u64` and `RngCore::fill_bytes`. (#288)
2018
- Add `RngCore::try_fill_bytes`. (#225)
2119

22-
## [0.0.1] - 2017-09-14
20+
## [0.0.1] - 2017-09-14 (yanked)
2321
Experimental version as part of the rand crate refactor.

rand-core/Cargo.toml renamed to rand_core/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[package]
2-
name = "rand-core"
2+
name = "rand_core"
33
version = "0.1.0-pre.0"
44
authors = ["The Rust Project Developers"]
55
license = "MIT/Apache-2.0"
66
readme = "README.md"
77
repository = "https://github.com/rust-lang-nursery/rand"
8-
documentation = "https://docs.rs/rand-core"
9-
homepage = "https://crates.io/crates/rand-core"
8+
documentation = "https://docs.rs/rand_core"
9+
homepage = "https://crates.io/crates/rand_core"
1010
description = """
1111
Core random number generator traits and tools for implementation.
1212
"""
File renamed without changes.
File renamed without changes.

rand-core/README.md renamed to rand_core/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
rand-core
1+
rand_core
22
====
33

44
Core traits and error types of the [rand] library, plus tools for implementing
@@ -14,7 +14,7 @@ applications (including sampling from restricted ranges, conversion to floating
1414
point, list permutations and secure initialisation of RNGs). Most users should
1515
prefer to use the main [rand] crate.
1616

17-
[Documentation](https://docs.rs/rand-core)
17+
[Documentation](https://docs.rs/rand_core)
1818

1919
[rand]: ../README.md
2020

File renamed without changes.
File renamed without changes.
File renamed without changes.

rand-core/src/lib.rs renamed to rand_core/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
3131
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk.png",
3232
html_favicon_url = "https://www.rust-lang.org/favicon.ico",
33-
html_root_url = "https://docs.rs/rand-core/0.1")]
33+
html_root_url = "https://docs.rs/rand_core/0.1")]
3434

3535
#![deny(missing_debug_implementations)]
3636

src/lib.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ extern crate rand_core;
269269

270270
use core::{marker, mem, slice};
271271

272-
// re-exports from rand-core
272+
// re-exports from rand_core
273273
pub use rand_core::{RngCore, BlockRngCore, CryptoRng, SeedableRng};
274274
pub use rand_core::{ErrorKind, Error};
275275

@@ -391,7 +391,7 @@ pub trait Rand : Sized {
391391
/// }
392392
/// ```
393393
///
394-
/// [`RngCore`]: https://docs.rs/rand-core/0.1/rand-core/trait.RngCore.html
394+
/// [`RngCore`]: https://docs.rs/rand_core/0.1/rand_core/trait.RngCore.html
395395
pub trait Rng: RngCore {
396396
/// Fill `dest` entirely with random bytes (uniform value distribution),
397397
/// where `dest` is any type supporting [`AsByteSliceMut`], namely slices
@@ -413,7 +413,7 @@ pub trait Rng: RngCore {
413413
/// thread_rng().try_fill(&mut arr[..]);
414414
/// ```
415415
///
416-
/// [`fill_bytes`]: https://docs.rs/rand-core/0.1/rand-core/trait.RngCore.html#method.fill_bytes
416+
/// [`fill_bytes`]: https://docs.rs/rand_core/0.1/rand_core/trait.RngCore.html#method.fill_bytes
417417
/// [`try_fill`]: trait.Rng.html#method.try_fill
418418
/// [`AsByteSliceMut`]: trait.AsByteSliceMut.html
419419
fn fill<T: AsByteSliceMut + ?Sized>(&mut self, dest: &mut T) {
@@ -448,8 +448,8 @@ pub trait Rng: RngCore {
448448
/// # try_inner().unwrap()
449449
/// ```
450450
///
451-
/// [`ErrorKind`]: https://docs.rs/rand-core/0.1/rand-core/enum.ErrorKind.html
452-
/// [`try_fill_bytes`]: https://docs.rs/rand-core/0.1/rand-core/trait.RngCore.html#method.try_fill_bytes
451+
/// [`ErrorKind`]: https://docs.rs/rand_core/0.1/rand_core/enum.ErrorKind.html
452+
/// [`try_fill_bytes`]: https://docs.rs/rand_core/0.1/rand_core/trait.RngCore.html#method.try_fill_bytes
453453
/// [`fill`]: trait.Rng.html#method.fill
454454
/// [`AsByteSliceMut`]: trait.AsByteSliceMut.html
455455
fn try_fill<T: AsByteSliceMut + ?Sized>(&mut self, dest: &mut T) -> Result<(), Error> {
@@ -803,8 +803,8 @@ impl<R: RngCore> Iterator for AsciiGenerator<R> {
803803
/// println!("Random die roll: {}", rng.gen_range(1, 7));
804804
/// ```
805805
///
806-
/// [`SeedableRng`]: https://docs.rs/rand-core/0.1/rand-core/trait.SeedableRng.html
807-
/// [`SeedableRng::from_seed`]: https://docs.rs/rand-core/0.1/rand-core/trait.SeedableRng.html#tymethod.from_seed
806+
/// [`SeedableRng`]: https://docs.rs/rand_core/0.1/rand_core/trait.SeedableRng.html
807+
/// [`SeedableRng::from_seed`]: https://docs.rs/rand_core/0.1/rand_core/trait.SeedableRng.html#tymethod.from_seed
808808
#[cfg(feature="std")]
809809
pub trait NewRng: SeedableRng {
810810
/// Creates a new instance, automatically seeded with fresh entropy.

0 commit comments

Comments
 (0)