diff options
| author | csmoe <35686186+csmoe@users.noreply.github.com> | 2018-10-09 17:53:59 +0800 |
|---|---|---|
| committer | csmoe <35686186+csmoe@users.noreply.github.com> | 2018-10-20 11:11:31 +0800 |
| commit | 2ed2d1a7e6a04896b6b0e30f2b07d0cd5f55afde (patch) | |
| tree | c7c2b0d389d674fa1072add7b1c8492ba25b2b25 /src/libsyntax/ast.rs | |
| parent | 42dde960f95222ffd8c356e0f7841cd22294a6c9 (diff) | |
| download | rust-2ed2d1a7e6a04896b6b0e30f2b07d0cd5f55afde.tar.gz rust-2ed2d1a7e6a04896b6b0e30f2b07d0cd5f55afde.zip | |
suggest to remove prefix `b` in lint string
Diffstat (limited to 'src/libsyntax/ast.rs')
| -rw-r--r-- | src/libsyntax/ast.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 9ed628e2ed3..24b016c3d98 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -1326,6 +1326,14 @@ impl LitKind { } } + /// Returns true if this literal is byte literal string false otherwise. + pub fn is_bytestr(&self) -> bool { + match self { + LitKind::ByteStr(_) => true, + _ => false, + } + } + /// Returns true if this is a numeric literal. pub fn is_numeric(&self) -> bool { match *self { |
