aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_mbe/src/tt_iter.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_mbe/src/tt_iter.rs')
-rw-r--r--crates/ra_mbe/src/tt_iter.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/crates/ra_mbe/src/tt_iter.rs b/crates/ra_mbe/src/tt_iter.rs
index 100184e66..46c420718 100644
--- a/crates/ra_mbe/src/tt_iter.rs
+++ b/crates/ra_mbe/src/tt_iter.rs
@@ -40,9 +40,11 @@ impl<'a> TtIter<'a> {
40 } 40 }
41 } 41 }
42 42
43 pub(crate) fn expect_literal(&mut self) -> Result<&'a tt::Literal, ()> { 43 pub(crate) fn expect_literal(&mut self) -> Result<&'a tt::Leaf, ()> {
44 match self.expect_leaf()? { 44 let it = self.expect_leaf()?;
45 tt::Leaf::Literal(it) => Ok(it), 45 match it {
46 tt::Leaf::Literal(_) => Ok(it),
47 tt::Leaf::Ident(ident) if ident.text == "true" || ident.text == "false" => Ok(it),
46 _ => Err(()), 48 _ => Err(()),
47 } 49 }
48 } 50 }