1
0
mirror of https://github.com/sharkdp/bat synced 2026-08-11 20:11:43 +00:00

Improve correctness and add more tests

This commit is contained in:
Aaron Kollasch
2022-10-25 22:18:03 -04:00
parent 36ccc6a31e
commit 76aad7c74f
4 changed files with 134 additions and 6 deletions
+2 -1
View File
@@ -145,8 +145,9 @@ pub fn get_args_from_env_vars() -> Vec<OsString> {
("--style", "BAT_STYLE"),
]
.iter()
.filter_map(|(flag, key)| env::var(key).ok().map(|var| [flag.into(), var.into()]))
.filter_map(|(flag, key)| env::var(key).ok().map(|var| [flag.to_string(), var]))
.flatten()
.map(|a| a.into())
.collect()
}