From 8a2723010290077bca034cd988067c70d0a638db Mon Sep 17 00:00:00 2001 From: Kevin Butler Date: Mon, 9 Nov 2015 21:04:31 +0000 Subject: libsyntax: use char::is_whitespace instead of custom implementations Fixes #29590. --- src/libsyntax/parse/lexer/mod.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/libsyntax/parse') 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) -> 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, lo: char, hi: char) -> bool { -- cgit 1.4.1-3-g733a5