diff options
| author | Tau Gärtli <git@tau.garden> | 2024-09-06 11:51:03 +0200 |
|---|---|---|
| committer | Thomas Otto <th1000s@posteo.net> | 2024-09-08 23:57:24 +0200 |
| commit | a66ac8e182df5f2862c2385ce35264082d9c10f8 (patch) | |
| tree | 390c1be4552cf93d210143476837ebd12aefa3c2 | |
| parent | cba999a99fb03ce5d82d8c7e0a3d8c9808f88d78 (diff) | |
Merge get_is_light* functions together
| -rw-r--r-- | src/options/theme.rs | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/options/theme.rs b/src/options/theme.rs index 6ce9604..6b9dbdc 100644 --- a/src/options/theme.rs +++ b/src/options/theme.rs @@ -98,20 +98,14 @@ fn get_is_light_mode_and_syntax_theme_name( } fn get_is_light(opt: &cli::Opt) -> Option<bool> { - get_is_light_opt(opt).or_else(|| { - should_detect_dark_light(opt) - .then(detect_light_mode) - .flatten() - }) -} - -fn get_is_light_opt(opt: &cli::Opt) -> Option<bool> { if opt.light { Some(true) } else if opt.dark { Some(false) } else { - None + should_detect_dark_light(opt) + .then(detect_light_mode) + .flatten() } } |
