Use more slice patterns inside the compiler
This commit is contained in:
parent
60d146580c
commit
c4c518d2d4
40 changed files with 191 additions and 221 deletions
|
@ -826,7 +826,8 @@ impl<'a> Parser<'a> {
|
|||
// We can only resolve single-segment paths at the moment, because multi-segment paths
|
||||
// require type-checking: see `visit_generic_arg` in `src/librustc_resolve/late.rs`.
|
||||
ast::ExprKind::Path(None, path)
|
||||
if path.segments.len() == 1 && path.segments[0].args.is_none() =>
|
||||
if let [segment] = path.segments.as_slice()
|
||||
&& segment.args.is_none() =>
|
||||
{
|
||||
true
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue