parser: Remove unnecessary back and forth during bitflags parsing.

This commit is contained in:
Emilio Cobos Álvarez
2019-02-23 19:47:40 -08:00
parent 7688507de6
commit 47fd0b5f5c
2 changed files with 3 additions and 4 deletions
+2 -2
View File
@@ -132,7 +132,7 @@ impl Flags {
}
}
pub fn parse(tokens: &str) -> ParseResult<Bitflags> {
pub fn parse(tokens: TokenStream) -> ParseResult<Bitflags> {
let parser = Bitflags::parse;
parser.parse_str(tokens)
parser.parse2(tokens)
}
+1 -2
View File
@@ -890,8 +890,7 @@ impl Parse {
return;
}
let tokens = item.mac.tts.to_string();
let bitflags = match bitflags::parse(&tokens) {
let bitflags = match bitflags::parse(item.mac.tts.clone()) {
Ok(b) => b,
Err(e) => {
warn!("Failed to parse bitflags invocation: {:?}", e);