about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-09-04 14:03:01 -0700
committerGitHub <noreply@github.com>2016-09-04 14:03:01 -0700
commit91f057de35066d0a34102bd0673b56684509b93d (patch)
tree6255961cbdaab893926148f0919c39be1c279e14 /src/libsyntax/parse
parent9cc430d2cf90a38880e02bb319a5563cbe07a40c (diff)
parente05e74ac831bc8438f5daeb98432a29285ed9514 (diff)
downloadrust-91f057de35066d0a34102bd0673b56684509b93d.tar.gz
rust-91f057de35066d0a34102bd0673b56684509b93d.zip
Auto merge of #36203 - petrochenkov:uvsdot, r=nrc
Replace `_, _` with `..` in patterns

This is how https://github.com/rust-lang/rust/issues/33627 looks in action.

Looks especially nice in leftmost/rightmost positions `(first, ..)`/`(.., last)`.
I haven't touched libsyntax intentionally because the feature is still unstable.
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/token.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs
index dc0fb02ea45..ff01d375815 100644
--- a/src/libsyntax/parse/token.rs
+++ b/src/libsyntax/parse/token.rs
@@ -180,7 +180,7 @@ impl Token {
             Ident(..)                   => true,
             Underscore                  => true,
             Tilde                       => true,
-            Literal(_, _)               => true,
+            Literal(..)                 => true,
             Not                         => true,
             BinOp(Minus)                => true,
             BinOp(Star)                 => true,
@@ -202,8 +202,8 @@ impl Token {
     /// Returns `true` if the token is any literal
     pub fn is_lit(&self) -> bool {
         match *self {
-            Literal(_, _) => true,
-            _             => false,
+            Literal(..) => true,
+            _           => false,
         }
     }