aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_mbe
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_mbe')
-rw-r--r--crates/ra_mbe/src/parser.rs17
1 files changed, 7 insertions, 10 deletions
diff --git a/crates/ra_mbe/src/parser.rs b/crates/ra_mbe/src/parser.rs
index 1cdebc216..10a6f300a 100644
--- a/crates/ra_mbe/src/parser.rs
+++ b/crates/ra_mbe/src/parser.rs
@@ -45,15 +45,15 @@ impl PartialEq for Separator {
45 } 45 }
46} 46}
47 47
48pub(crate) fn parse_template<'a>( 48pub(crate) fn parse_template(
49 template: &'a tt::Subtree, 49 template: &tt::Subtree,
50) -> impl Iterator<Item = Result<Op<'a>, ExpandError>> { 50) -> impl Iterator<Item = Result<Op<'_>, ExpandError>> {
51 parse_inner(template, Mode::Template) 51 parse_inner(template, Mode::Template)
52} 52}
53 53
54pub(crate) fn parse_pattern<'a>( 54pub(crate) fn parse_pattern(
55 pattern: &'a tt::Subtree, 55 pattern: &tt::Subtree,
56) -> impl Iterator<Item = Result<Op<'a>, ExpandError>> { 56) -> impl Iterator<Item = Result<Op<'_>, ExpandError>> {
57 parse_inner(pattern, Mode::Pattern) 57 parse_inner(pattern, Mode::Pattern)
58} 58}
59 59
@@ -63,10 +63,7 @@ enum Mode {
63 Template, 63 Template,
64} 64}
65 65
66fn parse_inner<'a>( 66fn parse_inner(src: &tt::Subtree, mode: Mode) -> impl Iterator<Item = Result<Op<'_>, ExpandError>> {
67 src: &'a tt::Subtree,
68 mode: Mode,
69) -> impl Iterator<Item = Result<Op<'a>, ExpandError>> {
70 let mut src = TtIter::new(src); 67 let mut src = TtIter::new(src);
71 std::iter::from_fn(move || { 68 std::iter::from_fn(move || {
72 let first = src.next()?; 69 let first = src.next()?;