Skip to content

Commit 0a89ac9

Browse files
Guillaume Desmottesgdesmott
Guillaume Desmottes
authored andcommitted
rename Libraries to Dependencies
This name is a bit more generic.
1 parent 422c1bc commit 0a89ac9

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/lib.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -193,11 +193,11 @@ pub enum Error {
193193

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

200-
impl Libraries {
200+
impl Dependencies {
201201
/// Retrieve details about a system dependency.
202202
///
203203
/// # Arguments
@@ -486,7 +486,7 @@ impl Config {
486486
/// `[package.metadata.system-deps]` section.
487487
///
488488
/// The returned hash is using the the `toml` key defining the dependency as key.
489-
pub fn probe(self) -> Result<Libraries, Error> {
489+
pub fn probe(self) -> Result<Dependencies, Error> {
490490
let libraries = self.probe_full()?;
491491
let flags = libraries.gen_flags()?;
492492

@@ -524,14 +524,14 @@ impl Config {
524524
}
525525
}
526526

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

531531
Ok(libraries)
532532
}
533533

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

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

544-
let mut libraries = Libraries::default();
544+
let mut libraries = Dependencies::default();
545545

546546
for dep in metadata.deps.iter() {
547547
let mut enabled_feature_overrides = Vec::new();

src/test.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use std::sync::Mutex;
88

99
use assert_matches::assert_matches;
1010

11-
use crate::Libraries;
11+
use crate::Dependencies;
1212

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

@@ -49,7 +49,7 @@ fn create_config(path: &str, env: Vec<(&'static str, &'static str)>) -> Config {
4949
fn toml(
5050
path: &str,
5151
env: Vec<(&'static str, &'static str)>,
52-
) -> Result<(Libraries, BuildFlags), Error> {
52+
) -> Result<(Dependencies, BuildFlags), Error> {
5353
let libs = create_config(path, env).probe_full()?;
5454
let flags = libs.gen_flags()?;
5555
Ok((libs, flags))
@@ -528,7 +528,7 @@ fn test_build_internal(
528528
path: &'static str,
529529
env: Vec<(&'static str, &'static str)>,
530530
expected_lib: &'static str,
531-
) -> Result<(Libraries, bool), (Error, bool)> {
531+
) -> Result<(Dependencies, bool), (Error, bool)> {
532532
let called = Rc::new(Cell::new(false));
533533
let called_clone = called.clone();
534534
let config = create_config(path, env).add_build_internal(expected_lib, move |lib, version| {

0 commit comments

Comments
 (0)