diff options
Diffstat (limited to 'src/libsyntax/parse')
| -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 { |
