mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
parser: remove unneccessary wrapping of return value in parse_extern()
This commit is contained in:
parent
00bc134e43
commit
85bd00fd85
@ -1679,7 +1679,7 @@ impl<'a> Parser<'a> {
|
||||
let constness = self.parse_constness();
|
||||
let asyncness = self.parse_asyncness();
|
||||
let unsafety = self.parse_unsafety();
|
||||
let ext = self.parse_extern()?;
|
||||
let ext = self.parse_extern();
|
||||
|
||||
if let Async::Yes { span, .. } = asyncness {
|
||||
self.ban_async_in_2015(span);
|
||||
|
@ -1202,12 +1202,8 @@ impl<'a> Parser<'a> {
|
||||
}
|
||||
|
||||
/// Parses `extern string_literal?`.
|
||||
fn parse_extern(&mut self) -> PResult<'a, Extern> {
|
||||
Ok(if self.eat_keyword(kw::Extern) {
|
||||
Extern::from_abi(self.parse_abi())
|
||||
} else {
|
||||
Extern::None
|
||||
})
|
||||
fn parse_extern(&mut self) -> Extern {
|
||||
if self.eat_keyword(kw::Extern) { Extern::from_abi(self.parse_abi()) } else { Extern::None }
|
||||
}
|
||||
|
||||
/// Parses a string literal as an ABI spec.
|
||||
|
Loading…
Reference in New Issue
Block a user