mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Stop using Vec::from_elem.
It is obsolete on Rust master.
This commit is contained in:
parent
60a901328a
commit
05c4e3b9f5
5 changed files with 15 additions and 8 deletions
|
@ -6,6 +6,7 @@ use std::collections::HashMap;
|
|||
use std::collections::hash_map::{Occupied, Vacant};
|
||||
use rand::Rng;
|
||||
use std::hash::{Hash, sip};
|
||||
use std::iter::repeat;
|
||||
use std::rand::task_rng;
|
||||
use std::slice::Items;
|
||||
|
||||
|
@ -148,7 +149,7 @@ impl<K:Clone+PartialEq+Hash,V:Clone> SimpleHashCache<K,V> {
|
|||
pub fn new(cache_size: uint) -> SimpleHashCache<K,V> {
|
||||
let mut r = task_rng();
|
||||
SimpleHashCache {
|
||||
entries: Vec::from_elem(cache_size, None),
|
||||
entries: repeat(None).take(cache_size).collect(),
|
||||
k0: r.gen(),
|
||||
k1: r.gen(),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue