Skip to content

Commit

Permalink
rename Libraries to Dependencies
Browse files Browse the repository at this point in the history
This name is a bit more generic.
  • Loading branch information
Guillaume Desmottes authored and gdesmott committed Feb 10, 2021
1 parent 422c1bc commit 0a89ac9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,11 @@ pub enum Error {

#[derive(Debug, Default)]
/// All the system dependencies retrieved by [Config::probe].
pub struct Libraries {
pub struct Dependencies {
libs: HashMap<String, Library>,
}

impl Libraries {
impl Dependencies {
/// Retrieve details about a system dependency.
///
/// # Arguments
Expand Down Expand Up @@ -486,7 +486,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<Libraries, Error> {
pub fn probe(self) -> Result<Dependencies, Error> {
let libraries = self.probe_full()?;
let flags = libraries.gen_flags()?;

Expand Down Expand Up @@ -524,14 +524,14 @@ impl Config {
}
}

fn probe_full(mut self) -> Result<Libraries, Error> {
fn probe_full(mut self) -> Result<Dependencies, Error> {
let mut libraries = self.probe_pkg_config()?;
libraries.override_from_flags(&self.env);

Ok(libraries)
}

fn probe_pkg_config(&mut self) -> Result<Libraries, Error> {
fn probe_pkg_config(&mut self) -> Result<Dependencies, Error> {
let dir = self
.env
.get("CARGO_MANIFEST_DIR")
Expand All @@ -541,7 +541,7 @@ impl Config {

let metadata = MetaData::from_file(&path)?;

let mut libraries = Libraries::default();
let mut libraries = Dependencies::default();

for dep in metadata.deps.iter() {
let mut enabled_feature_overrides = Vec::new();
Expand Down
6 changes: 3 additions & 3 deletions src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::sync::Mutex;

use assert_matches::assert_matches;

use crate::Libraries;
use crate::Dependencies;

use super::{BuildFlags, BuildInternalClosureError, Config, EnvVariables, Error, Library};

Expand Down Expand Up @@ -49,7 +49,7 @@ fn create_config(path: &str, env: Vec<(&'static str, &'static str)>) -> Config {
fn toml(
path: &str,
env: Vec<(&'static str, &'static str)>,
) -> Result<(Libraries, BuildFlags), Error> {
) -> Result<(Dependencies, BuildFlags), Error> {
let libs = create_config(path, env).probe_full()?;
let flags = libs.gen_flags()?;
Ok((libs, flags))
Expand Down Expand Up @@ -528,7 +528,7 @@ fn test_build_internal(
path: &'static str,
env: Vec<(&'static str, &'static str)>,
expected_lib: &'static str,
) -> Result<(Libraries, bool), (Error, bool)> {
) -> Result<(Dependencies, bool), (Error, bool)> {
let called = Rc::new(Cell::new(false));
let called_clone = called.clone();
let config = create_config(path, env).add_build_internal(expected_lib, move |lib, version| {
Expand Down

0 comments on commit 0a89ac9

Please sign in to comment.