Skip to content

Commit

Permalink
fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
gdesmott committed Apr 7, 2023
1 parent 32957fc commit ce24d5f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ pub struct Config {

impl Default for Config {
fn default() -> Self {
Self::new_with_env(EnvVariables::Environnement)
Self::new_with_env(EnvVariables::Environment)
}
}

Expand Down Expand Up @@ -995,7 +995,7 @@ impl Library {

#[derive(Debug)]
enum EnvVariables {
Environnement,
Environment,
#[cfg(test)]
Mock(HashMap<&'static str, String>),
}
Expand All @@ -1018,7 +1018,7 @@ trait EnvVariablesExt<T> {
impl EnvVariablesExt<&str> for EnvVariables {
fn get(&self, var: &str) -> Option<String> {
match self {
EnvVariables::Environnement => env::var(var).ok(),
EnvVariables::Environment => env::var(var).ok(),
#[cfg(test)]
EnvVariables::Mock(vars) => vars.get(var).cloned(),
}
Expand Down
16 changes: 8 additions & 8 deletions src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,13 +346,13 @@ cargo:rerun-if-env-changed=SYSTEM_DEPS_LINK
fn override_lib() {
let (libraries, flags) = toml(
"toml-good",
vec![("SYSTEM_DEPS_TESTLIB_LIB", "overrided-test other-test")],
vec![("SYSTEM_DEPS_TESTLIB_LIB", "overridden-test other-test")],
)
.unwrap();
let testlib = libraries.get_by_name("testlib").unwrap();
assert_eq!(
testlib.libs,
vec!["overrided-test", "other-test"]
vec!["overridden-test", "other-test"]
.into_iter()
.map(|name| InternalLib::new(name.to_string(), false))
.collect::<Vec<InternalLib>>()
Expand All @@ -362,7 +362,7 @@ fn override_lib() {
flags,
r#"cargo:rustc-link-search=native=/usr/lib/
cargo:rustc-link-search=framework=/usr/lib/
cargo:rustc-link-lib=overrided-test
cargo:rustc-link-lib=overridden-test
cargo:rustc-link-lib=other-test
cargo:rustc-link-lib=framework=someframework
cargo:include=/usr/include/testlib
Expand Down Expand Up @@ -392,18 +392,18 @@ cargo:rerun-if-env-changed=SYSTEM_DEPS_LINK
fn override_framework() {
let (libraries, flags) = toml(
"toml-good",
vec![("SYSTEM_DEPS_TESTLIB_LIB_FRAMEWORK", "overrided-framework")],
vec![("SYSTEM_DEPS_TESTLIB_LIB_FRAMEWORK", "overridden-framework")],
)
.unwrap();
let testlib = libraries.get_by_name("testlib").unwrap();
assert_eq!(testlib.frameworks, vec!["overrided-framework"]);
assert_eq!(testlib.frameworks, vec!["overridden-framework"]);

assert_flags(
flags,
r#"cargo:rustc-link-search=native=/usr/lib/
cargo:rustc-link-search=framework=/usr/lib/
cargo:rustc-link-lib=test
cargo:rustc-link-lib=framework=overrided-framework
cargo:rustc-link-lib=framework=overridden-framework
cargo:include=/usr/include/testlib
cargo:rerun-if-env-changed=SYSTEM_DEPS_TESTDATA_INCLUDE
cargo:rerun-if-env-changed=SYSTEM_DEPS_TESTDATA_LIB
Expand Down Expand Up @@ -724,7 +724,7 @@ fn build_internal_fail() {
}

#[test]
fn build_internal_always_gobal() {
fn build_internal_always_global() {
let called = Rc::new(Cell::new((false, false)));
let called_clone = called.clone();
let called_clone2 = called.clone();
Expand Down Expand Up @@ -759,7 +759,7 @@ fn build_internal_always_gobal() {
}

#[test]
fn build_internal_gobal_override() {
fn build_internal_global_override() {
// Request to build all libs using global var but disable it for a specific one
let called = Rc::new(Cell::new((false, false)));
let called_clone = called.clone();
Expand Down

0 comments on commit ce24d5f

Please # to comment.