From c784c8ec766edf4c7ab558f71d3f87e6c7c870b9 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Thu, 26 Nov 2020 16:04:23 +0100 Subject: Use named fields in `ExpandResult` --- crates/mbe/src/mbe_expander/matcher.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'crates/mbe/src/mbe_expander/matcher.rs') diff --git a/crates/mbe/src/mbe_expander/matcher.rs b/crates/mbe/src/mbe_expander/matcher.rs index 39a8eefbd..3f8445897 100644 --- a/crates/mbe/src/mbe_expander/matcher.rs +++ b/crates/mbe/src/mbe_expander/matcher.rs @@ -158,7 +158,8 @@ fn match_subtree( continue; } }; - let ExpandResult(matched, match_err) = match_meta_var(kind.as_str(), src); + let ExpandResult { value: matched, err: match_err } = + match_meta_var(kind.as_str(), src); match matched { Some(fragment) => { res.bindings.inner.insert(name.clone(), Binding::Fragment(fragment)); @@ -342,17 +343,17 @@ impl<'a> TtIter<'a> { token_trees: res.into_iter().cloned().collect(), })), }; - ExpandResult(res, err) + ExpandResult { value: res, err } } pub(crate) fn eat_vis(&mut self) -> Option { let mut fork = self.clone(); match fork.expect_fragment(Visibility) { - ExpandResult(tt, None) => { + ExpandResult { value: tt, err: None } => { *self = fork; tt } - ExpandResult(_, Some(_)) => None, + ExpandResult { value: _, err: Some(_) } => None, } } } -- cgit v1.2.3