Convert a bool to Trailing
.
This pre-existing type is suitable for use with the return value of the `f` parameter in `collect_tokens_trailing_token`. The more descriptive name will be useful because the next commit will add another boolean value to the return value of `f`.
This commit is contained in:
parent
55906aa240
commit
c8098be41f
8 changed files with 52 additions and 40 deletions
|
@ -388,6 +388,12 @@ enum Trailing {
|
|||
Yes,
|
||||
}
|
||||
|
||||
impl From<bool> for Trailing {
|
||||
fn from(b: bool) -> Trailing {
|
||||
if b { Trailing::Yes } else { Trailing::No }
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
pub(super) enum TokenDescription {
|
||||
ReservedIdentifier,
|
||||
|
@ -1549,7 +1555,7 @@ impl<'a> Parser<'a> {
|
|||
self.collect_tokens_trailing_token(
|
||||
AttrWrapper::empty(),
|
||||
ForceCollect::Yes,
|
||||
|this, _attrs| Ok((f(this)?, false)),
|
||||
|this, _attrs| Ok((f(this)?, Trailing::No)),
|
||||
)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue