##// END OF EJS Templates
rust-discovery: type alias for random generator seed...
Georges Racinet -
r44494:2abffea4 default
parent child Browse files
Show More
@@ -18,6 +18,7 b' use std::cmp::{max, min};'
18 18 use std::collections::{HashSet, VecDeque};
19 19
20 20 type Rng = rand_pcg::Pcg32;
21 type Seed = [u8; 16];
21 22
22 23 pub struct PartialDiscovery<G: Graph + Clone> {
23 24 target_heads: Option<Vec<Revision>>,
@@ -158,7 +159,7 b' impl<G: Graph + Clone> PartialDiscovery<'
158 159 respect_size: bool,
159 160 randomize: bool,
160 161 ) -> Self {
161 let mut seed: [u8; 16] = [0; 16];
162 let mut seed = [0; 16];
162 163 if randomize {
163 164 thread_rng().fill_bytes(&mut seed);
164 165 }
@@ -168,7 +169,7 b' impl<G: Graph + Clone> PartialDiscovery<'
168 169 pub fn new_with_seed(
169 170 graph: G,
170 171 target_heads: Vec<Revision>,
171 seed: [u8; 16],
172 seed: Seed,
172 173 respect_size: bool,
173 174 randomize: bool,
174 175 ) -> Self {
General Comments 0
You need to be logged in to leave comments. Login now