D7715: rust-discovery: type alias for random generator seed

gracinet (Georges Racinet) phabricator at mercurial-scm.org
Thu Jan 9 09:57:08 EST 2020


Closed by commit rHG2abffea40700: rust-discovery: type alias for random generator seed (authored by gracinet).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7715?vs=18923&id=19126

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7715/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7715

AFFECTED FILES
  rust/hg-core/src/discovery.rs

CHANGE DETAILS

diff --git a/rust/hg-core/src/discovery.rs b/rust/hg-core/src/discovery.rs
--- a/rust/hg-core/src/discovery.rs
+++ b/rust/hg-core/src/discovery.rs
@@ -18,6 +18,7 @@
 use std::collections::{HashSet, VecDeque};
 
 type Rng = rand_pcg::Pcg32;
+type Seed = [u8; 16];
 
 pub struct PartialDiscovery<G: Graph + Clone> {
     target_heads: Option<Vec<Revision>>,
@@ -158,7 +159,7 @@
         respect_size: bool,
         randomize: bool,
     ) -> Self {
-        let mut seed: [u8; 16] = [0; 16];
+        let mut seed = [0; 16];
         if randomize {
             thread_rng().fill_bytes(&mut seed);
         }
@@ -168,7 +169,7 @@
     pub fn new_with_seed(
         graph: G,
         target_heads: Vec<Revision>,
-        seed: [u8; 16],
+        seed: Seed,
         respect_size: bool,
         randomize: bool,
     ) -> Self {



To: gracinet, #hg-reviewers, Alphare, pulkit
Cc: durin42, kevincox, mercurial-devel


More information about the Mercurial-devel mailing list