aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_mbe/src
diff options
context:
space:
mode:
authorKirill Bulatov <[email protected]>2020-02-18 13:32:19 +0000
committerKirill Bulatov <[email protected]>2020-02-18 14:12:37 +0000
commiteceaf94f1936436e33ae235ca65bf2a6d4f77da5 (patch)
tree83d42e6f014f80b84f9193e6b5c7c1e2aded9fa7 /crates/ra_mbe/src
parentb8ddcb0652f3ec8683023afc1e1f5166d6a712f4 (diff)
More manual clippy fixes
Diffstat (limited to 'crates/ra_mbe/src')
-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()?;