From 6787a93fa2f128dc5a9859b48b84585f347efa3c Mon Sep 17 00:00:00 2001 From: Ryan Hunt Date: Tue, 4 Apr 2017 14:04:19 -0400 Subject: [PATCH] Add a comment explaing rust_lib --- src/rust_lib.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/rust_lib.rs b/src/rust_lib.rs index 2588d3e..5860c29 100644 --- a/src/rust_lib.rs +++ b/src/rust_lib.rs @@ -4,6 +4,15 @@ use std::path::PathBuf; use syn; +/* + * Recursively parses a rust library starting at the root crate's directory. + * + * Inside a crate, `mod` and `extern crate` declarations are followed + * and parsed. To find an external crate, the parser looks in the + * parent directory of the root crate. This could be improved + * to read the crate's Cargo.toml to find the crate, but it works well + * enough to find the crates that matter for creating bindings. + */ pub fn parse(crate_dir: String, items_callback: &F) where F: Fn(String, &Vec)