parser: Remove unnecessary back and forth during bitflags parsing.
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user