1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-26 03:21:16 +02:00

Update to async/await-enabled tokio

This commit is contained in:
Eelco Dolstra 2019-12-04 15:32:28 +01:00
parent 7f08975050
commit a6f0bef0a7
7 changed files with 274 additions and 533 deletions

View file

@ -14,10 +14,9 @@ pub extern "C" fn unpack_tarfile(
#[no_mangle]
pub extern "C" fn rust_test() {
/*
use crate::store::{self, Store};
use futures::future::{FutureExt, TryFutureExt};
use std::path::Path;
use tokio::runtime::Runtime;
let fut = async move {
let store: Box<dyn Store> = Box::new(store::BinaryCacheStore::new(
@ -36,17 +35,21 @@ pub extern "C" fn rust_test() {
eprintln!("INFO = {:?}", info);
*/
let closure = store.compute_path_closure(vec![path].into_iter().collect()).await.unwrap();
let closure = store
.compute_path_closure(vec![path].into_iter().collect())
.await
.unwrap();
eprintln!("CLOSURE = {:?}", closure.len());
Ok(())
};
tokio::run(fut.boxed().compat());
*/
let rt = Runtime::new().unwrap();
rt.block_on(fut);
/*
let file = std::fs::File::open("test.nar").unwrap();
crate::nar::parse(&mut std::io::BufReader::new(file)).unwrap();
*/
}