mirror of
https://github.com/sharkdp/bat.git
synced 2025-01-19 12:24:17 +00:00
Use map instead of and_then(..Some(..))
This commit is contained in:
parent
bf53b64125
commit
c899849101
@ -286,7 +286,7 @@ impl App {
|
|||||||
theme: self
|
theme: self
|
||||||
.matches
|
.matches
|
||||||
.value_of("theme")
|
.value_of("theme")
|
||||||
.and_then(|theme_name_arg| Some(String::from(theme_name_arg)))
|
.map(String::from)
|
||||||
.or_else(|| {
|
.or_else(|| {
|
||||||
env::var("BAT_THEME").ok().and_then(|theme_name_env| {
|
env::var("BAT_THEME").ok().and_then(|theme_name_env| {
|
||||||
if HighlightingAssets::new().theme_exists(&theme_name_env) {
|
if HighlightingAssets::new().theme_exists(&theme_name_env) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user