@@ -98,18 +98,21 @@ pub(crate) fn get_pager(config_pager: Option<&str>) -> Result<Option<Pager>, Par
9898 Some((bin, args)) => {
9999 let kind = PagerKind::from_bin(bin);
100100
101− let use_less_instead = match (&source, &kind) {
102− // 'more' and 'most' do not supports colors; automatically use 'less' instead
103− // if the problematic pager came from the generic PAGER env var
104− (PagerSource::EnvVarPager, PagerKind::More) => true,
105− (PagerSource::EnvVarPager, PagerKind::Most) => true,
106−
107− // If PAGER=bat, silently use 'less' instead to prevent recursion ...
108− (PagerSource::EnvVarPager, PagerKind::Bat) => true,
109−
110− // Never silently use less if BAT_PAGER or --pager has been specified
111− _ => false,
112− };
101+ // Is false if the given expression does not match any of the
102+ // patterns; this ensures 'less' is never silently used if BAT_PAGER
103+ // or --pager has been specified.
104+ let use_less_instead = matches!(
105+ (&source, &kind),
106+ // 'more' and 'most' do not supports colors; automatically use
107+ // 'less' instead if the problematic pager came from the
108+ // generic PAGER env var
109+ (PagerSource::EnvVarPager, PagerKind::More)
110+ | (PagerSource::EnvVarPager, PagerKind::Most)
111+
112+ // If PAGER=bat, silently use 'less' instead to prevent
113+ // recursion ...
114+ | (PagerSource::EnvVarPager, PagerKind::Bat)
115+ );
113116
114117 Ok(Some(if use_less_instead {
115118 let no_args = vec![];