diff --git a/src/lib.rs b/src/lib.rs index f122692..70f8879 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -191,15 +191,12 @@ pub enum Error { } #[derive(Debug, Default)] -struct Libraries { +/// All the system dependencies retrieved by [Config::probe]. +pub struct Libraries { libs: HashMap, } impl Libraries { - fn into_hash(self) -> HashMap { - self.libs - } - /// Retrieve details about a system dependency. /// /// # Arguments @@ -427,7 +424,7 @@ impl Config { /// `[package.metadata.system-deps]` section. /// /// The returned hash is using the the `toml` key defining the dependency as key. - pub fn probe(self) -> Result, Error> { + pub fn probe(self) -> Result { let libraries = self.probe_full()?; let flags = libraries.gen_flags()?; @@ -438,7 +435,7 @@ impl Config { println!("cargo:rustc-cfg=system_deps_have_{}", name.to_snake_case()); } - Ok(libraries.into_hash()) + Ok(libraries) } /// Add hook so system-deps can internally build library `name` if requested by user.