rollup merge of #23886: demelev/remove_as_slice_usage
This commit is contained in:
commit
6d2c640cf0
24 changed files with 41 additions and 42 deletions
|
|
@ -198,7 +198,7 @@ impl Rand for ChaChaRng {
|
|||
for word in &mut key {
|
||||
*word = other.gen();
|
||||
}
|
||||
SeedableRng::from_seed(key.as_slice())
|
||||
SeedableRng::from_seed(&key[..])
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ pub trait Rng : Sized {
|
|||
///
|
||||
/// let mut v = [0; 13579];
|
||||
/// thread_rng().fill_bytes(&mut v);
|
||||
/// println!("{:?}", v.as_slice());
|
||||
/// println!("{:?}", v);
|
||||
/// ```
|
||||
fn fill_bytes(&mut self, dest: &mut [u8]) {
|
||||
// this could, in theory, be done by transmuting dest to a
|
||||
|
|
@ -310,9 +310,9 @@ pub trait Rng : Sized {
|
|||
/// let mut rng = thread_rng();
|
||||
/// let mut y = [1, 2, 3];
|
||||
/// rng.shuffle(&mut y);
|
||||
/// println!("{:?}", y.as_slice());
|
||||
/// println!("{:?}", y);
|
||||
/// rng.shuffle(&mut y);
|
||||
/// println!("{:?}", y.as_slice());
|
||||
/// println!("{:?}", y);
|
||||
/// ```
|
||||
fn shuffle<T>(&mut self, values: &mut [T]) {
|
||||
let mut i = values.len();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue