mirror of
https://github.com/Llewellynvdm/exa.git
synced 2024-11-15 16:57:08 +00:00
Environment Default trait
The Environment struct only used the Default trait so it could have the same call for both Environment<UsersCache> and Environment<MockUsers>. There’s no reason to keep it around anymore.
This commit is contained in:
parent
651d23fe8a
commit
d27812f819
@ -140,7 +140,7 @@ impl<'a> Render<'a> {
|
||||
let mut rows = Vec::new();
|
||||
|
||||
if let Some(columns) = self.opts.columns {
|
||||
let env = Environment::default();
|
||||
let env = Environment::load_all();
|
||||
let colz = columns.for_dir(self.dir);
|
||||
let mut table = Table::new(&colz, &self.colours, &env);
|
||||
|
||||
|
@ -47,7 +47,7 @@ impl<'a> Render<'a> {
|
||||
None => Vec::new(),
|
||||
};
|
||||
|
||||
let env = Environment::default();
|
||||
let env = Environment::load_all();
|
||||
|
||||
let drender = self.clone().details();
|
||||
|
||||
|
@ -41,10 +41,8 @@ impl Environment {
|
||||
pub fn lock_users(&self) -> MutexGuard<UsersCache> {
|
||||
self.users.lock().unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for Environment {
|
||||
fn default() -> Self {
|
||||
pub fn load_all() -> Self {
|
||||
let tz = match determine_time_zone() {
|
||||
Ok(t) => Some(t),
|
||||
Err(ref e) => {
|
||||
|
Loading…
Reference in New Issue
Block a user