Mercurial > hg
comparison rust/hg-core/src/discovery.rs @ 42763:04c3b76fa7a3
rust-discovery: remove useless extern crate
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Fri, 16 Aug 2019 18:31:17 +0900 |
parents | c5748c6969b9 |
children | 798b7d4b463e |
comparison
equal
deleted
inserted
replaced
42762:ac6121a24f27 | 42763:04c3b76fa7a3 |
---|---|
8 //! Discovery operations | 8 //! Discovery operations |
9 //! | 9 //! |
10 //! This is a Rust counterpart to the `partialdiscovery` class of | 10 //! This is a Rust counterpart to the `partialdiscovery` class of |
11 //! `mercurial.setdiscovery` | 11 //! `mercurial.setdiscovery` |
12 | 12 |
13 extern crate rand; | |
14 extern crate rand_pcg; | |
15 use self::rand::seq::SliceRandom; | |
16 use self::rand::{thread_rng, RngCore, SeedableRng}; | |
17 use super::{Graph, GraphError, Revision, NULL_REVISION}; | 13 use super::{Graph, GraphError, Revision, NULL_REVISION}; |
18 use crate::ancestors::MissingAncestors; | 14 use crate::ancestors::MissingAncestors; |
19 use crate::dagops; | 15 use crate::dagops; |
16 use rand::seq::SliceRandom; | |
17 use rand::{thread_rng, RngCore, SeedableRng}; | |
20 use std::cmp::{max, min}; | 18 use std::cmp::{max, min}; |
21 use std::collections::{HashMap, HashSet, VecDeque}; | 19 use std::collections::{HashMap, HashSet, VecDeque}; |
22 | 20 |
23 type Rng = self::rand_pcg::Pcg32; | 21 type Rng = rand_pcg::Pcg32; |
24 | 22 |
25 pub struct PartialDiscovery<G: Graph + Clone> { | 23 pub struct PartialDiscovery<G: Graph + Clone> { |
26 target_heads: Option<Vec<Revision>>, | 24 target_heads: Option<Vec<Revision>>, |
27 graph: G, // plays the role of self._repo | 25 graph: G, // plays the role of self._repo |
28 common: MissingAncestors<G>, | 26 common: MissingAncestors<G>, |