diff --git a/src/options/mod.rs b/src/options/mod.rs index 2217ef6..5ef3bf1 100644 --- a/src/options/mod.rs +++ b/src/options/mod.rs @@ -89,6 +89,9 @@ use self::version::VersionString; mod misfire; pub use self::misfire::Misfire; +mod vars; +pub use self::vars::Vars; + mod parser; mod flags; use self::parser::MatchedFlags; @@ -162,28 +165,13 @@ impl Options { } -/// Mockable wrapper for `std::env::var_os`. -pub trait Vars { - fn get(&self, name: &'static str) -> Option; -} - - - #[cfg(test)] pub mod test { - use super::{Options, Misfire, Vars, flags}; + use super::{Options, Misfire, flags}; use options::parser::{Arg, MatchedFlags}; use std::ffi::OsString; - // Test impl that just returns the value it has. - impl Vars for Option { - fn get(&self, _name: &'static str) -> Option { - self.clone() - } - } - - #[derive(PartialEq, Debug)] pub enum Strictnesses { Last, diff --git a/src/options/vars.rs b/src/options/vars.rs new file mode 100644 index 0000000..4116457 --- /dev/null +++ b/src/options/vars.rs @@ -0,0 +1,16 @@ +use std::ffi::OsString; + + +/// Mockable wrapper for `std::env::var_os`. +pub trait Vars { + fn get(&self, name: &'static str) -> Option; +} + + +// Test impl that just returns the value it has. +#[cfg(test)] +impl Vars for Option { + fn get(&self, _name: &'static str) -> Option { + self.clone() + } +}