mirror of
https://github.com/sharkdp/bat.git
synced 2025-09-02 03:12:25 +01:00
Matcher parser errors when empty
This commit is contained in:
@@ -86,6 +86,10 @@ impl FromStr for Matcher {
|
|||||||
})
|
})
|
||||||
.collect_vec();
|
.collect_vec();
|
||||||
|
|
||||||
|
if non_empty_segments.is_empty() {
|
||||||
|
bail!(r#"Parsed an empty matcher: "{s}""#);
|
||||||
|
}
|
||||||
|
|
||||||
if non_empty_segments.iter().any(|seg| match seg {
|
if non_empty_segments.iter().any(|seg| match seg {
|
||||||
Seg::Text(t) => t.contains(['$', '{', '}']),
|
Seg::Text(t) => t.contains(['$', '{', '}']),
|
||||||
Seg::Env(_) => false,
|
Seg::Env(_) => false,
|
||||||
|
Reference in New Issue
Block a user