diff options
| author | Kevin Butler <haqkrs@gmail.com> | 2015-11-09 21:04:31 +0000 |
|---|---|---|
| committer | Kevin Butler <haqkrs@gmail.com> | 2016-01-14 22:47:50 +0000 |
| commit | 8a2723010290077bca034cd988067c70d0a638db (patch) | |
| tree | 6cf649b81664d88deb192d55f00cbf4f3bd5ff1c /src/libsyntax/parse/lexer | |
| parent | c12c42de0ac3f4ab50f2c138e53e6e94f8da11ec (diff) | |
| download | rust-8a2723010290077bca034cd988067c70d0a638db.tar.gz rust-8a2723010290077bca034cd988067c70d0a638db.zip | |
libsyntax: use char::is_whitespace instead of custom implementations
Fixes #29590.
Diffstat (limited to 'src/libsyntax/parse/lexer')
| -rw-r--r-- | src/libsyntax/parse/lexer/mod.rs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/libsyntax/parse/lexer/mod.rs b/src/libsyntax/parse/lexer/mod.rs index 1402b7888dd..3e61aaff3c9 100644 --- a/src/libsyntax/parse/lexer/mod.rs +++ b/src/libsyntax/parse/lexer/mod.rs @@ -1592,10 +1592,7 @@ impl<'a> StringReader<'a> { } pub fn is_whitespace(c: Option<char>) -> bool { - match c.unwrap_or('\x00') { // None can be null for now... it's not whitespace - ' ' | '\n' | '\t' | '\r' => true, - _ => false, - } + c.map_or(false, char::is_whitespace) } fn in_range(c: Option<char>, lo: char, hi: char) -> bool { |
