rustfmt_nightly::patterns

Function is_short_pattern

source
pub(crate) fn is_short_pattern(pat: &Pat, pat_str: &str) -> bool
Expand description

Returns true if the given pattern is “short”. A short pattern is defined by the following grammar:

[small, ntp]: - single token - &[single-line, ntp]

[small]: - [small, ntp] - unary tuple constructor ([small, ntp]) - &[small]