Remove 'mut' from self signature in ReachabilityIndex signature.

Summary: The 'mut' requirement wasn't required for structs implementing `ReachabilityIndex`, and will get in the way when incorporating this work into the Mononoke server / API server.

Reviewed By: StanislavGlebik

Differential Revision: D9142238

fbshipit-source-id: 4853b468bf04493289fb017bf56b3a1753f29dcd
This commit is contained in:
Matthew Dippel 2018-08-06 11:02:02 -07:00 committed by Facebook Github Bot
parent 9abd29d4c3
commit c04e4d49e6
5 changed files with 7 additions and 7 deletions

View File

@ -81,7 +81,7 @@ impl MononokeRepoActor {
proposed_ancestor: String,
proposed_descendent: String,
) -> Result<BoxFuture<MononokeRepoResponse, Error>> {
let mut genbfs = GenerationNumberBFS::new();
let genbfs = GenerationNumberBFS::new();
let src_hash_maybe = FS::get_nodehash(&proposed_descendent);
let dst_hash_maybe = FS::get_nodehash(&proposed_ancestor);
let src_hash_future = src_hash_maybe.into_future().or_else({

View File

@ -75,7 +75,7 @@ fn process_bfs_layer(
impl ReachabilityIndex for GenerationNumberBFS {
fn query_reachability(
&mut self,
&self,
repo: Arc<BlobRepo>,
src: HgNodeHash,
dst: HgNodeHash,

View File

@ -16,7 +16,7 @@ use mercurial_types::HgNodeHash;
pub trait ReachabilityIndex {
/// Return a Future for whether the src node can reach the dst node
fn query_reachability(
&mut self,
&self,
repo: Arc<BlobRepo>,
src: HgNodeHash,
dst: HgNodeHash,

View File

@ -349,7 +349,7 @@ impl SkiplistIndex {
impl ReachabilityIndex for SkiplistIndex {
fn query_reachability(
&mut self,
&self,
repo: Arc<BlobRepo>,
src: HgNodeHash,
dst: HgNodeHash,

View File

@ -23,7 +23,7 @@ use index::ReachabilityIndex;
pub fn test_linear_reachability<T: ReachabilityIndex + 'static>(index_creator: fn() -> T) {
async_unit::tokio_unit_test(move || {
let repo = Arc::new(linear::getrepo(None));
let mut index = index_creator();
let index = index_creator();
let ordered_hashes = vec![
string_to_nodehash("a9473beb2eb03ddb1cccc3fbaeb8a4820f9cd157"),
string_to_nodehash("0ed509bf086fadcb8a8a5384dc3b550729b0fc17"),
@ -51,7 +51,7 @@ pub fn test_linear_reachability<T: ReachabilityIndex + 'static>(index_creator: f
pub fn test_merge_uneven_reachability<T: ReachabilityIndex + 'static>(index_creator: fn() -> T) {
async_unit::tokio_unit_test(move || {
let repo = Arc::new(merge_uneven::getrepo(None));
let mut index = index_creator();
let index = index_creator();
let root_node = string_to_nodehash("15c40d0abc36d47fb51c8eaec51ac7aad31f669c");
// order is oldest to newest
@ -105,7 +105,7 @@ pub fn test_branch_wide_reachability<T: ReachabilityIndex + 'static>(index_creat
async_unit::tokio_unit_test(move || {
// this repo has no merges but many branches
let repo = Arc::new(branch_wide::getrepo(None));
let mut index = index_creator();
let index = index_creator();
let root_node = string_to_nodehash("ecba698fee57eeeef88ac3dcc3b623ede4af47bd");
let b1 = string_to_nodehash("9e8521affb7f9d10e9551a99c526e69909042b20");