about summary refs log tree commit diff
path: root/src/libsyntax/ext/bytes.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-05-02 07:06:50 -0700
committerbors <bors@rust-lang.org>2014-05-02 07:06:50 -0700
commitb5d6b07370b665df6b54fa20e971e61041a233b0 (patch)
tree4a43dbe1601f640ebb8bade6d67898c74bdea0e6 /src/libsyntax/ext/bytes.rs
parente97d4e6c190764de1240c2e8a5ac253a60faac6b (diff)
parent1ad0cba5e6a837fdebf5f5543d4b169929972705 (diff)
downloadrust-b5d6b07370b665df6b54fa20e971e61041a233b0.tar.gz
rust-b5d6b07370b665df6b54fa20e971e61041a233b0.zip
auto merge of #13879 : huonw/rust/more-re, r=alexcrichton
Commits for details.

This shouldn't change the generated code at all (except for switching to `LitBinary` from an explicit ExprVec of individual ExprLit bytes for `prefix_bytes`).
Diffstat (limited to 'src/libsyntax/ext/bytes.rs')
-rw-r--r--src/libsyntax/ext/bytes.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/libsyntax/ext/bytes.rs b/src/libsyntax/ext/bytes.rs
index f4680b27084..c6349d616ec 100644
--- a/src/libsyntax/ext/bytes.rs
+++ b/src/libsyntax/ext/bytes.rs
@@ -16,8 +16,6 @@ use ext::base::*;
 use ext::base;
 use ext::build::AstBuilder;
 
-use std::char;
-
 pub fn expand_syntax_ext(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree]) -> ~base::MacResult {
     // Gather all argument expressions
     let exprs = match get_exprs_from_tts(cx, sp, tts) {
@@ -59,7 +57,7 @@ pub fn expand_syntax_ext(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree]) ->
 
                 // char literal, push to vector expression
                 ast::LitChar(v) => {
-                    if char::from_u32(v).unwrap().is_ascii() {
+                    if v.is_ascii() {
                         bytes.push(cx.expr_u8(expr.span, v as u8));
                     } else {
                         cx.span_err(expr.span, "non-ascii char literal in bytes!")