Use map instead of and_then(..Some(..))
commitc89984910172d1a8bcd245861e66c2860eca6c38
authorsharkdp <davidpeter@web.de>
dateMon 23 Jul 2018, 21:19 (8 years ago)
parentbf53b64
src/app.rs+1−1
@@ -286,7 +286,7 @@ impl App {
286286 theme: self
287287 .matches
288288 .value_of("theme")
289− .and_then(|theme_name_arg| Some(String::from(theme_name_arg)))
289+ .map(String::from)
290290 .or_else(|| {
291291 env::var("BAT_THEME").ok().and_then(|theme_name_env| {
292292 if HighlightingAssets::new().theme_exists(&theme_name_env) {