aboutsummaryrefslogtreecommitdiff
path: root/nix-rust/src/c.rs
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-09-18 00:31:51 +0200
committerEelco Dolstra <edolstra@gmail.com>2019-12-10 13:37:23 +0100
commit7f08975050e19b3e3ed002743ed19022789c7ccc (patch)
treeabfbadd19848490618684c892caf21afc182a766 /nix-rust/src/c.rs
parent6317f0f7a0663aed9d877031f7815fa292bd6b09 (diff)
Add NAR parser
Diffstat (limited to 'nix-rust/src/c.rs')
-rw-r--r--nix-rust/src/c.rs14
1 files changed, 12 insertions, 2 deletions
diff --git a/nix-rust/src/c.rs b/nix-rust/src/c.rs
index 1abd34198..542df93d2 100644
--- a/nix-rust/src/c.rs
+++ b/nix-rust/src/c.rs
@@ -1,4 +1,8 @@
-use super::{foreign::{self, CBox}, error, util, store};
+use super::{
+ error,
+ foreign::{self, CBox},
+ util,
+};
#[no_mangle]
pub extern "C" fn unpack_tarfile(
@@ -10,7 +14,8 @@ pub extern "C" fn unpack_tarfile(
#[no_mangle]
pub extern "C" fn rust_test() {
- use crate::store::Store;
+ /*
+ use crate::store::{self, Store};
use futures::future::{FutureExt, TryFutureExt};
use std::path::Path;
@@ -39,4 +44,9 @@ pub extern "C" fn rust_test() {
};
tokio::run(fut.boxed().compat());
+ */
+
+ let file = std::fs::File::open("test.nar").unwrap();
+
+ crate::nar::parse(&mut std::io::BufReader::new(file)).unwrap();
}