edenapi: avoid EdenApiBlocking in C bindings

Summary: Unblocks removing `EdenApiBlocking`.

Reviewed By: yancouto

Differential Revision: D31416612

fbshipit-source-id: c2aa1add69c24ba247c4bdcfcacaeaceb15ac0d6
This commit is contained in:
Jun Wu 2021-10-06 17:12:12 -07:00 committed by Facebook GitHub Bot
parent c22c44397e
commit cbb7df0fc1

View File

@ -12,7 +12,7 @@ use anyhow::Error;
use libc::size_t;
use edenapi::EdenApi;
use edenapi::{Builder, EdenApiBlocking};
use edenapi::{BlockingResponse, Builder};
use edenapi_types::{EdenApiServerError, TreeEntry};
use types::Key as ApiKey;
@ -58,9 +58,10 @@ fn edenapi_trees_blocking(
.iter()
.map(|k| k.try_into())
.collect::<Result<Vec<ApiKey>, _>>()?;
Ok(client
.trees_blocking(repo, keys, Some(attrs.into()))
.map(|f| f.entries)?)
Ok(
BlockingResponse::from_async(client.trees(repo, keys, Some(attrs.into())))
.map(|f| f.entries)?,
)
}
#[no_mangle]