From 6f635f7d8abf955368904621646ca245f74d3d38 Mon Sep 17 00:00:00 2001 From: Yan Soares Couto Date: Thu, 9 Sep 2021 07:41:57 -0700 Subject: [PATCH] No need to implement for Arc Summary: As far as I could tell, this was legacy from some refactorings. It was only used in one place, and it was easy to fix. Also, if we really need it in the future, we can probably use `#[auto_impl]` instead of doing it manually. Reviewed By: StanislavGlebik Differential Revision: D30574803 fbshipit-source-id: 20715364713775818fe0e83844637f48b310d87f --- .../src/backingstore/contentstores.rs | 1 - eden/scm/lib/edenapi/trait/src/api.rs | 258 ------------------ 2 files changed, 259 deletions(-) diff --git a/eden/scm/lib/backingstore/src/backingstore/contentstores.rs b/eden/scm/lib/backingstore/src/backingstore/contentstores.rs index c6a45c6b0f..b735e39ab3 100644 --- a/eden/scm/lib/backingstore/src/backingstore/contentstores.rs +++ b/eden/scm/lib/backingstore/src/backingstore/contentstores.rs @@ -57,7 +57,6 @@ impl BackingContentStores { let (blobstore, treestore) = match config.get_opt::("remotefilelog", "reponame")? { Some(repo) if use_edenapi => { let edenapi = EdenApiBuilder::from_config(config)?.build()?; - let edenapi: Arc = Arc::new(edenapi); let fileremotestore = EdenApiFileStore::new(repo.clone(), edenapi.clone(), None); let treeremotestore = EdenApiTreeStore::new(repo, edenapi, None); ( diff --git a/eden/scm/lib/edenapi/trait/src/api.rs b/eden/scm/lib/edenapi/trait/src/api.rs index 244fbb08c3..84856cdd0d 100644 --- a/eden/scm/lib/edenapi/trait/src/api.rs +++ b/eden/scm/lib/edenapi/trait/src/api.rs @@ -5,9 +5,7 @@ * GNU General Public License version 2. */ -use std::borrow::Borrow; use std::num::NonZeroU64; -use std::sync::Arc; use async_trait::async_trait; @@ -206,259 +204,3 @@ pub trait EdenApi: Send + Sync + 'static { request: FetchSnapshotRequest, ) -> Result, EdenApiError>; } - -#[async_trait] -impl EdenApi for Arc { - async fn health(&self) -> Result { - as Borrow>::borrow(self) - .health() - .await - } - - async fn files( - &self, - repo: String, - keys: Vec, - progress: Option, - ) -> Result, EdenApiError> { - as Borrow>::borrow(self) - .files(repo, keys, progress) - .await - } - - async fn files_attrs( - &self, - repo: String, - reqs: Vec, - progress: Option, - ) -> Result, EdenApiError> { - as Borrow>::borrow(self) - .files_attrs(repo, reqs, progress) - .await - } - - async fn history( - &self, - repo: String, - keys: Vec, - length: Option, - progress: Option, - ) -> Result, EdenApiError> { - as Borrow>::borrow(self) - .history(repo, keys, length, progress) - .await - } - - async fn trees( - &self, - repo: String, - keys: Vec, - attributes: Option, - progress: Option, - ) -> Result>, EdenApiError> { - as Borrow>::borrow(self) - .trees(repo, keys, attributes, progress) - .await - } - - async fn complete_trees( - &self, - repo: String, - rootdir: RepoPathBuf, - mfnodes: Vec, - basemfnodes: Vec, - depth: Option, - progress: Option, - ) -> Result>, EdenApiError> { - as Borrow>::borrow(self) - .complete_trees(repo, rootdir, mfnodes, basemfnodes, depth, progress) - .await - } - - async fn commit_revlog_data( - &self, - repo: String, - hgids: Vec, - progress: Option, - ) -> Result, EdenApiError> { - as Borrow>::borrow(self) - .commit_revlog_data(repo, hgids, progress) - .await - } - - async fn clone_data(&self, repo: String) -> Result, EdenApiError> { - as Borrow>::borrow(self) - .clone_data(repo) - .await - } - - async fn pull_fast_forward_master( - &self, - repo: String, - old_master: HgId, - new_master: HgId, - ) -> Result, EdenApiError> { - as Borrow>::borrow(self) - .pull_fast_forward_master(repo, old_master, new_master) - .await - } - - async fn full_idmap_clone_data( - &self, - repo: String, - progress: Option, - ) -> Result, EdenApiError> { - as Borrow>::borrow(self) - .full_idmap_clone_data(repo, progress) - .await - } - - async fn commit_location_to_hash( - &self, - repo: String, - requests: Vec, - progress: Option, - ) -> Result, EdenApiError> { - as Borrow>::borrow(self) - .commit_location_to_hash(repo, requests, progress) - .await - } - - async fn commit_hash_to_location( - &self, - repo: String, - master_heads: Vec, - hgids: Vec, - progress: Option, - ) -> Result, EdenApiError> { - as Borrow>::borrow(self) - .commit_hash_to_location(repo, master_heads, hgids, progress) - .await - } - - async fn commit_known( - &self, - repo: String, - hgids: Vec, - ) -> Result, EdenApiError> { - as Borrow>::borrow(self) - .commit_known(repo, hgids) - .await - } - - async fn commit_graph( - &self, - repo: String, - heads: Vec, - common: Vec, - ) -> Result, EdenApiError> { - as Borrow>::borrow(self) - .commit_graph(repo, heads, common) - .await - } - - async fn hash_prefixes_lookup( - &self, - repo: String, - prefixes: Vec, - ) -> Result, EdenApiError> { - as Borrow>::borrow(self) - .hash_prefixes_lookup(repo, prefixes) - .await - } - - async fn bookmarks( - &self, - repo: String, - bookmarks: Vec, - progress: Option, - ) -> Result, EdenApiError> { - as Borrow>::borrow(self) - .bookmarks(repo, bookmarks, progress) - .await - } - - async fn lookup_batch( - &self, - repo: String, - items: Vec, - bubble_id: Option, - ) -> Result, EdenApiError> { - as Borrow>::borrow(self) - .lookup_batch(repo, items, bubble_id) - .await - } - - async fn process_files_upload( - &self, - repo: String, - data: Vec<(AnyFileContentId, Bytes)>, - bubble_id: Option, - ) -> Result, EdenApiError> { - as Borrow>::borrow(self) - .process_files_upload(repo, data, bubble_id) - .await - } - - - async fn upload_filenodes_batch( - &self, - repo: String, - items: Vec, - ) -> Result, EdenApiError> { - as Borrow>::borrow(self) - .upload_filenodes_batch(repo, items) - .await - } - - async fn upload_trees_batch( - &self, - repo: String, - items: Vec, - ) -> Result, EdenApiError> { - as Borrow>::borrow(self) - .upload_trees_batch(repo, items) - .await - } - - async fn upload_changesets( - &self, - repo: String, - changesets: Vec, - mutations: Vec, - ) -> Result, EdenApiError> { - as Borrow>::borrow(self) - .upload_changesets(repo, changesets, mutations) - .await - } - - async fn upload_bonsai_changeset( - &self, - repo: String, - changeset: BonsaiChangesetContent, - bubble_id: Option, - ) -> Result, EdenApiError> { - as Borrow>::borrow(self) - .upload_bonsai_changeset(repo, changeset, bubble_id) - .await - } - - async fn ephemeral_prepare( - &self, - repo: String, - ) -> Result, EdenApiError> { - as Borrow>::borrow(self) - .ephemeral_prepare(repo) - .await - } - - async fn fetch_snapshot( - &self, - repo: String, - request: FetchSnapshotRequest, - ) -> Result, EdenApiError> { - as Borrow>::borrow(self) - .fetch_snapshot(repo, request) - .await - } -}