2
0
mirror of https://github.com/sharkdp/bat synced 2024-11-16 21:25:56 +00:00

Use map instead of and_then(..Some(..))

This commit is contained in:
sharkdp 2018-07-23 21:19:47 +02:00 committed by David Peter
parent bf53b64125
commit c899849101

View File

@ -286,7 +286,7 @@ impl App {
theme: self
.matches
.value_of("theme")
.and_then(|theme_name_arg| Some(String::from(theme_name_arg)))
.map(String::from)
.or_else(|| {
env::var("BAT_THEME").ok().and_then(|theme_name_env| {
if HighlightingAssets::new().theme_exists(&theme_name_env) {