exa/src/options/vars.rs

17 lines
336 B
Rust
Raw Normal View History

2017-08-26 19:48:51 +00:00
use std::ffi::OsString;
/// Mockable wrapper for `std::env::var_os`.
pub trait Vars {
fn get(&self, name: &'static str) -> Option<OsString>;
}
// Test impl that just returns the value it has.
#[cfg(test)]
impl Vars for Option<OsString> {
fn get(&self, _name: &'static str) -> Option<OsString> {
self.clone()
}
}