mirror of
https://github.com/Llewellynvdm/exa.git
synced 2024-09-28 05:09:01 +00:00
17 lines
336 B
Rust
17 lines
336 B
Rust
|
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()
|
||
|
}
|
||
|
}
|