Add a b"xx" byte string literal of type &'static [u8].
This commit is contained in:
@@ -2342,19 +2342,9 @@ impl<'a> State<'a> {
|
||||
ast::LitBool(val) => {
|
||||
if val { word(&mut self.s, "true") } else { word(&mut self.s, "false") }
|
||||
}
|
||||
ast::LitBinary(ref arr) => {
|
||||
try!(self.ibox(indent_unit));
|
||||
try!(word(&mut self.s, "["));
|
||||
try!(self.commasep_cmnt(Inconsistent,
|
||||
arr.as_slice(),
|
||||
|s, u| {
|
||||
word(&mut s.s,
|
||||
format!("{}",
|
||||
*u).as_slice())
|
||||
},
|
||||
|_| lit.span));
|
||||
try!(word(&mut self.s, "]"));
|
||||
self.end()
|
||||
ast::LitBinary(ref v) => {
|
||||
let escaped: String = v.iter().map(|&b| b as char).collect();
|
||||
word(&mut self.s, format!("b\"{}\"", escaped.escape_default()).as_slice())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user